feat: add Python APIs for surface-wave dispersion and modal summation#271
Open
YuanYusung wants to merge 2 commits into
Open
feat: add Python APIs for surface-wave dispersion and modal summation#271YuanYusung wants to merge 2 commits into
YuanYusung wants to merge 2 commits into
Conversation
Owner
|
感谢你关注到PyGRT,也感谢你的首次PR! 事实上我感觉我的Python部分与C部分的业务逻辑存在重复,这对于后续推进维护会埋下隐患。因此近段时间的代码重构和更新我尽量还没有碰Python。 所以很抱歉我暂时还不能merge,我过段时间会仔细review,并且思考如何简化我的整个Python部分的写法,给出一个更简洁的框架。 再一次感谢你的贡献! ❤️ 👍 |
Author
|
@Dengda98 ,你好! 感谢你的回复! 最近我在用 PyGRT 做面波模拟,发现目前还没有提供面波工作流程的 Python 接口。在 AI 的辅助下,我尝试实现了这个接口,并提交了这个 PR。我主要用了 ChatGPT 和 Codex,ChatGPT 主要帮我完善初版代码和 PR 说明;Codex 主要帮我理解 PyGRT 的整体结构、整理测试脚本,以及跑本地检查。 这个 PR 的初衷是先提供一个可用的 Python 面波合成接口,从而更方便地开展面波相关的研究。我也完全理解你对 Python 和 C 部分之间业务逻辑重复的担忧。如果之后你计划重构 Python 部分,我非常乐意根据新的框架调整这个 PR;如果还有其他我可以帮忙的地方,我也很愿意参与。 这也是我第一次尝试为开源项目做贡献,如果实现或 PR 流程中有不成熟的地方,还请多多包涵。 再次感谢你的耐心回复,也感谢你开发和维护 PyGRT!🫡 它是一个非常实用的波形合成软件,相信以后会有越来越多研究者使用。👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds initial Python APIs for PyGRT surface-wave modal workflows:
PyModel1D.compute_dispersion(...)PyModel1D.compute_surface_grn(...)pygrt.PyDispersionThe implementation exposes Python access to the existing C modal solvers for
eigenvandmodsum, following the current ctypes-based PyGRT style.Scope
This first PR focuses on:
test/eigenvandtest/modsumshell testsOut of scope for this PR:
eigenfnThese can be added in follow-up PRs.
Tests
Passed locally:
compileall only reports pre-existing SyntaxWarnings in unrelated plotting strings.