-
Notifications
You must be signed in to change notification settings - Fork 0
Site generation #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pegasus
Are you sure you want to change the base?
Site generation #67
Conversation
Summary of ChangesHello @claudio525, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the workflow by introducing a robust framework for generating custom virtual simulation site grids. This new capability allows users to define specific criteria for site selection, ensuring consistency across different simulation sets while maintaining the flexibility for tailored analyses. The change also involves the removal of an outdated 'merge timeslices' utility, simplifying the overall system architecture. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive support for generating custom virtual site grids for earthquake simulations. The main purpose is to enable creation of domain-specific site grids by sub-sampling a high-density "general" grid, ensuring consistency across simulation sets while allowing customization. Additionally, this PR removes the deprecated merge timeslices functionality.
Key changes:
- New
site_gen.pymodule implementing custom grid generation with configurable filters (land-only, regional bounds, uniform spacing, basin-specific spacing) - CLI commands in
site_gen_cmds.pyfor grid generation and visualization - Removal of merge timeslices stage and related code
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| workflow/site_gen.py | Core implementation of general and custom grid classes with filtering capabilities |
| workflow/scripts/site_gen_cmds.py | Command-line interface for grid generation and plotting |
| workflow/scripts/plan_workflow.py | Removed deprecated MergeTimeslices stage identifier |
| workflow/scripts/merge_ts_loop.pyx | Deleted Cython implementation for timeslice merging |
| workflow/scripts/merge_ts.py | Deleted merge timeslices script |
| workflow/init.py | Removed merge timeslices documentation reference |
| wiki/Stages.md | Removed merge timeslices stage documentation |
| wiki/Site-Generation.md | Added comprehensive documentation for site generation feature |
| setup.py | Deleted setup file for Cython extensions |
| pyproject.toml | Removed merge-ts console script entry point |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant new feature for generating custom site grids, while also cleaning up by removing the old merge-ts functionality. The new site generation code is well-structured, but I've found several critical issues related to coordinate transformations that will cause incorrect geographical plotting of domains and sources. There are also some high-severity correctness issues in the grid-masking logic and inconsistencies between the implementation and the new documentation. Addressing these points will be crucial for the feature to work as intended and be understood by users. I've also included some medium-severity suggestions to improve code quality and usability.
|
These LLM comments look mostly reasonable. I'll take a pass at it once they are resolved. |
|
See also: the pytest coverage checks are failing. You need some tests for your code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - basin: The basin the site is in (if any). | ||
| - Z1.0: The Z1.0 value for the site (if vel_model_version is provided). | ||
| - Z2.5: The Z2.5 value for the site (if vel_model_version is provided). | ||
| - site_code: The site code. |
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring is missing documentation for the 'Vs30' column. According to line 701, 'Vs30' is loaded from the NZGMDB data for real sites, and this column is referenced in the plotting code (site_gen_cmds.py lines 169, 177, 199, 207). The documentation should include: - Vs30: Time-averaged shear-wave velocity in the top 30 meters (m/s) (for real sites only).
| - site_code: The site code. | |
| - site_code: The site code. | |
| - Vs30: Time-averaged shear-wave velocity in the top 30 meters (m/s) (for real sites only). |
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary blank lines (lines 415-418). These are leftover whitespace that should be cleaned up.
Adds support for generating custom site grids. See the Wiki page for details.