Skip to content

Add XML#88

Merged
joelridden merged 8 commits into4p4from
xml
Jan 20, 2026
Merged

Add XML#88
joelridden merged 8 commits into4p4from
xml

Conversation

@joelridden
Copy link
Contributor

Adds the XML station inventory files.
Reduces needed retrieval of inventory info from the FDSN by using local files.
Adds XML to the dropbox upload process.
Changed remove sensitivity to remove response.
Adjusted wiki and changelog.

@gemini-code-assist
Copy link

Summary of Changes

Hello @joelridden, 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 data processing pipeline by integrating local StationXML inventory files, which streamlines waveform processing by reducing external API calls. It also refines the instrument response removal mechanism from remove_sensitivity to remove_response for improved accuracy and flexibility. These changes are supported by updates across various modules, including data retrieval, calculation, and management, and are thoroughly documented in the changelog and wiki.

Highlights

  • StationXML Integration: Introduced the capability to fetch, save, and utilize local StationXML inventory files for waveform processing, reducing reliance on FDSN for inventory information.
  • Processing Logic Update: Switched from remove_sensitivity to remove_response in waveform processing across multiple modules, ensuring more accurate instrument response removal and handling different output types (ACC/VEL).
  • Dropbox Integration: Added support for zipping and uploading StationXML inventory files to Dropbox, and a corresponding option to ignore their download during archive retrieval.
  • Changelog and Wiki Updates: Updated the project's changelog to reflect new features and increased date range, and revised wiki documentation for SNR calculation, record processing, waveform extraction, and Dropbox upload to align with these changes.
  • Date Range Extension: Extended the data processing date range in the changelog to the end of 2025.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 improvement by caching station inventory XML files, which reduces reliance on FDSN services. The changes are extensive, touching data retrieval, processing, and documentation. The core logic of switching from remove_sensitivity to remove_response is correctly implemented.

However, I've identified a few issues:

  • A critical logic error in waveform_manipulation.py that inverts the inventory handling.
  • Code duplication and lack of error handling when reading XML files.
  • Inefficient and non-robust station data fetching in the new inventory_xml.py module.
  • A non-reproducible default date.

I've provided detailed comments and suggestions to address these points. Once these are resolved, the PR will be in great shape.

@joelridden joelridden marked this pull request as draft January 6, 2026 03:13
# Conflicts:
#	nzgmdb/calculation/snr.py
#	nzgmdb/data_processing/process_observed.py
#	nzgmdb/data_processing/waveform_manipulation.py
#	nzgmdb/data_retrieval/sites.py
#	nzgmdb/mseed_management/reading.py
@joelridden joelridden marked this pull request as ready for review January 15, 2026 23:01
Copy link
Contributor

@lispandfound lispandfound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor type checking issues.

Comment on lines +116 to +117
bypass_row: pd.Series = None,
inventory: Inventory = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bypass_row: pd.Series = None,
inventory: Inventory = None,
bypass_row: pd.Series | None = None,
inventory: Inventory | None = None,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't use this sadly due to a forced python 3.8 or 3.9 for PhaseNet and GMC

def run_phasenet(
mseed_files_ffp: Path, output_dir: Path, bypass_ffp: Path | None = None
):
def run_phasenet(mseed_files_ffp: Path, output_dir: Path, bypass_ffp: Path = None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def run_phasenet(mseed_files_ffp: Path, output_dir: Path, bypass_ffp: Path = None):
def run_phasenet(mseed_files_ffp: Path, output_dir: Path, bypass_ffp: Path | None = None):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't use this sadly due to a forced python 3.8 or 3.9 for PhaseNet and GMC

@joelridden joelridden merged commit 7af56eb into 4p4 Jan 20, 2026
5 checks passed
@joelridden joelridden deleted the xml branch January 20, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants