Conversation
- Move SRF file directly when only one source geometry is present - Avoid unnecessary call to stitch_srf_files for single geometry cases
Summary of ChangesHello @lispandfound, 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 enhances the intensity measure (IM) calculation workflow by introducing explicit control over parallel processing and refining data handling. It also optimizes the SRF file generation process for single-source scenarios, improving efficiency by avoiding unnecessary operations. Highlights
Changelog
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.
Code Review
This pull request introduces several valuable improvements. In im_calc.py, it adds configurable parallel processing for intensity measure calculations, removes the numexpr dependency, and refactors waveform handling to be more direct, which is a great enhancement. The changes in realisation_to_srf.py correctly handle the case for a single source geometry, avoiding unnecessary processing. My review includes one suggestion to replace a magic number with a named constant to improve code clarity and maintainability.
There was a problem hiding this comment.
Pull request overview
Updates the SRF generation and IM calculation scripts to better handle single-fault SRF outputs and to make IM computation configurable for parallel execution.
Changes:
- Avoids SRF “stitching” when there is only a single source geometry by moving/renaming the generated SRF instead.
- Adds a
--coresoption toim-calcand threads this through to IM calculation functions. - Adjusts IM calculation input preparation (dtype and array handling) and PSA period dtype.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
workflow/scripts/realisation_to_srf.py |
Skips stitching for single-geometry ruptures and moves the generated SRF to the final expected filename. |
workflow/scripts/im_calc.py |
Adds configurable core count and updates how waveform arrays/parameters are prepared and passed into IM functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AndrewRidden-Harper
left a comment
There was a problem hiding this comment.
One small suggestion for a docstring but otherwise, looks great
Co-authored-by: AndrewRidden-Harper <52001209+AndrewRidden-Harper@users.noreply.github.com>
9ff843a
No description provided.