Skip to content

Revive merge-ts hdf5 merging#86

Merged
lispandfound merged 18 commits intopegasusfrom
revive_hdf5_merge_ts
Jan 20, 2026
Merged

Revive merge-ts hdf5 merging#86
lispandfound merged 18 commits intopegasusfrom
revive_hdf5_merge_ts

Conversation

@lispandfound
Copy link
Contributor

When @claudio525 created the very helpful PR to remove merge-ts we might've gone a little overboard... We removed the merging code that needed Cython, but then the full python xarray xyts->hdf5 logic was also deleted! This PR re-adds merge-ts with just the HDF5 output. I also slightly refactored the reading logic by extracting out helper functions instead of one big main function. At some point, these helper functions will be extracted into the qcore.xyts module.

Copilot AI review requested due to automatic review settings January 8, 2026 20:09
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 restores the merge-ts utility, which was previously removed, specifically focusing on its HDF5 output capabilities. It re-implements the merging of EMOD3D timeslice files into a single HDF5 file using Python's xarray library. The implementation also includes a refactoring of the data reading logic into several dedicated helper functions, improving code organization and maintainability.

Highlights

  • Re-introduction of merge-ts: The merge-ts utility has been re-added to the project, specifically restoring its functionality for merging EMOD3D timeslice files into HDF5 format.
  • Refactored Reading Logic: The data reading and processing logic within merge-ts has been refactored into several modular helper functions, enhancing code organization and maintainability. These functions are intended for future extraction into the qcore.xyts module.
  • Xarray Integration for HDF5 Output: The script now leverages the xarray library for robust handling of N-dimensional data, coordinate generation, and efficient saving of the merged timeslice data to HDF5 files with compression.
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 revives the merge-ts script for HDF5 merging, which was accidentally removed. The new implementation is a pure Python script using xarray and typer. The refactoring into helper functions is a good improvement for readability and future reuse.

My review focuses on improving correctness, robustness, and maintainability. I've identified a critical issue where the script would crash if no input files are found, a data type inconsistency that could lead to errors, and some minor improvements regarding a magic number and docstring correctness. Overall, this is a great addition and the refactoring is well done.

Copy link

Copilot AI left a 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 revives the merge-ts HDF5 merging functionality that was previously removed. The implementation is now purely Python-based (no Cython dependencies) and provides a command-line tool to merge EMOD3D timeslice files into a single HDF5 output file with quantized waveform data.

Key changes:

  • Re-introduces workflow/scripts/merge_ts.py with a refactored architecture using helper functions
  • Adds merge-ts command-line entry point in pyproject.toml
  • Implements XYTS file reading, waveform magnitude calculation, and HDF5 output generation with compression

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
workflow/scripts/merge_ts.py New script implementing XYTS file merging with helper functions for reading component files, extracting metadata, calculating coordinates, and creating compressed HDF5 output
pyproject.toml Adds merge-ts command-line entry point mapping to the new merge_ts module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a 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 2 out of 2 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lispandfound lispandfound merged commit 1a1abd7 into pegasus Jan 20, 2026
7 checks passed
@lispandfound lispandfound deleted the revive_hdf5_merge_ts branch January 20, 2026 03:32
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