🔧 Refactor Prodigy XY loader: add support for 1D XPS data#160
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
==========================================
- Coverage 72.23% 72.22% -0.02%
==========================================
Files 228 228
Lines 14668 14662 -6
Branches 1218 1223 +5
==========================================
- Hits 10596 10589 -7
Misses 3843 3843
- Partials 229 230 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
|
I am getting Ruff errors from the files that where not modified... |
803204b to
aec54ae
Compare
Owner
|
Could you also add a changelog entry to docs/source/CHANGELOG.rst ? |
…port 1D/2D/3D
- refactor _parse_xy_dims to return only real dimensions (no empty placeholders)
- remove artificial third dimension ("thirddim") and rely on header-defined parameters
- introduce unified axes model (energy + optional dimensions)
- generalize data reshaping to support arbitrary number of dimensions
- fix handling of 1D data (no NonEnergyOrdinate)
- simplify to_data_array by dynamically building coords and dims from axes
- add validation of data size against expected axis dimensions
DSNP_UMCS plugin update:
- avoid assuming presence of "nonenergy" coordinate
This refactor removes hardcoded dimensional assumptions and prepares the loader
for future extensions (e.g. additional scan parameters / higher dimensions).
- remove unused axis_info and MAP_DIMENSION - simplify load_xy by forwarding kwargs - add helper function _reshape_intensity - use dict.get for safer param access - add comments for non-obvious logic - rename some variables for clarity
- Fixed a bud in regex used to catch dim names and values - Use named regex groups instead of positional - Fixed n_other calculation - it was returning a float value for an empty xy_dims. - Use np.allclose in float value comparison.
- The axis_info property was removed and now a datastructure axes is used instead - Added test_axes_match_data_shape
- add named regex groups for key-value parsing - introduce HEADER_VALUES_TYPES for explicit type casting - remove implicit float casting in favor of controlled schema
The plugin is primarily used for parsing and loading data from Prodigy .xy files. This change removes the Prodigy class and consolidates its functionality into the load_xy function, supported by helper functions.
1089406 to
c74ce28
Compare
Updated version number from 5.1.0 to 5.0.3 and removed old entry.
Author
|
I've rebased this branch to include the latest changes from main and added a changelog entry on top. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for 1D Prodigy .xy files, used e.g. in XPS/AES where the detector’s non‑energy channels are integrated, and therefore there is no "NonEnergyOrdinate" in the file.
Supporting XPS data required reworking how dimensions are detected and reshaped, so a large part of the plugin was rewritten.
During this cleanup I also removed the old ProdigyXY class, which was essentially unused, the module now exposes only the functional API with
load_xy()as the main public entry point, as it was before.The new structure is simpler and better prepared for future extensions (e.g. higher‑dimensional scans).