Skip to content

Conversation

@michael-petersen
Copy link
Owner

@michael-petersen michael-petersen commented Jul 26, 2023

Based on a user request, I've been thinking about how to best implement HDF5 structure for file outputs. This is a draft implementation of an HDF5 phase-space system.

Still to be done:

  • Add an HDF5 reader for easier interface
  • Verify that this can be used externally with static methods
  • Decide if the group strategy for headers makes the most sense

@michael-petersen
Copy link
Owner Author

Some of this is superseded by an implementation of a standard in EXP; it makes sense to keep this but perhaps as an internal-only format.

@michael-petersen michael-petersen changed the base branch from main to devel December 12, 2025 10:03
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 introduces a draft HDF5 converter for PSP format files and makes significant improvements to code documentation and style across multiple analysis modules. The changes modernize the codebase by replacing legacy file I/O with HDF5, improving docstrings to follow Google-style conventions, and refactoring calculations to use more efficient numpy methods.

Key Changes:

  • Adds a new HDF5 converter class to convert PSP particle simulation files to HDF5 format
  • Updates trapping analysis to use HDF5 for output instead of binary files
  • Refactors kmeans implementation with improved documentation and K-means++ initialization
  • Enhances pattern analysis classes with comprehensive docstrings and new BarFromCoefficients class

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 22 comments.

File Description
exptool/io/psp_to_hdf5.py New HDF5 converter class with methods to convert PSP files to HDF5 format, including header and phase space data handling
exptool/utils/kmeans.py Documentation improvements, code cleanup, addition of K-means++ initialization method, and refactoring for better readability
exptool/analysis/trapping.py Migration from binary file output to HDF5 format, documentation improvements, error message standardization, and numpy optimization
exptool/analysis/pattern.py New BarFromCoefficients class, enhanced documentation for BarTransform and BarFromFourier classes, and improved code organization
Comments suppressed due to low confidence (2)

exptool/io/psp_to_hdf5.py:91

        self.convert_psp_to_hdf5()

exptool/io/psp_to_hdf5.py:148

  • Except block directly handles BaseException.
                            except:

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

michael-petersen and others added 3 commits December 12, 2025 10:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 12, 2025

@michael-petersen I've opened a new pull request, #48, to work on those changes. Once the pull request is ready, I'll request review from you.

michael-petersen and others added 2 commits December 12, 2025 10:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 12, 2025

@michael-petersen I've opened a new pull request, #49, to work on those changes. Once the pull request is ready, I'll request review from you.

michael-petersen and others added 2 commits December 12, 2025 10:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
michael-petersen and others added 7 commits December 12, 2025 10:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 12, 2025

@michael-petersen I've opened a new pull request, #50, to work on those changes. Once the pull request is ready, I'll request review from you.

michael-petersen and others added 5 commits December 12, 2025 11:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 12, 2025

@michael-petersen I've opened a new pull request, #51, to work on those changes. Once the pull request is ready, I'll request review from you.

michael-petersen and others added 10 commits December 12, 2025 11:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix unused parameters in HDFConverter.__init__
Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
Specify exception types in bare except clauses
Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
…r-one

Fix HDFConverter static method inconsistency
Co-authored-by: michael-petersen <19195541+michael-petersen@users.noreply.github.com>
Fix self.oldmu initialization causing TypeError in KMeans.find_centers()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants