-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guard against length-1 arrays used for scalar detector metadata #460
Merged
Conversation
This file contains 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
Some NXmx data sources write single-valued data as length-1 1-d arrays, rather than as scalar data sets. A key offender is Dectris, who write lots of their Eiger metadata in this way. Squeeze all NXdetector properties to guard against malformed values.
Codecov Report
@@ Coverage Diff @@
## main #460 +/- ##
==========================================
- Coverage 66.42% 66.28% -0.14%
==========================================
Files 185 185
Lines 17011 17109 +98
Branches 2381 2423 +42
==========================================
+ Hits 11299 11341 +42
- Misses 5144 5194 +50
- Partials 568 574 +6 |
benjaminhwilliams
changed the title
Guard against length-1 arrays used for scalar data
Guard against length-1 arrays used for scalar detector metadata
Jan 12, 2022
# Conflicts: # src/dxtbx/nexus/nxmx.py
After discussion we'd like to get this in here now so that we can test and refine against live data. Tests will follow once we know that it's working for its intended purpose. |
Merged
ndevenish
pushed a commit
that referenced
this pull request
Feb 7, 2022
Some NXmx data sources write single-valued data as length-1 1-d arrays, rather than as scalar data sets. Dectris writes lots of their Eiger metadata in this way. Squeeze all NXdetector properties to guard against malformed values.
benjaminhwilliams
added a commit
that referenced
this pull request
Mar 14, 2022
Adds a test for changes introduced in #460.
benjaminhwilliams
added a commit
that referenced
this pull request
Mar 14, 2022
Adds a test for changes introduced in #460.
benjaminhwilliams
added a commit
that referenced
this pull request
Mar 15, 2022
According to the NeXus specification, we currently represent as ints or floats some quantities that have, or can have, measurement units. Ensure that these data are represented as pint.Quantity instances instead, so that we can retain any units defined in the corresponding HDF5 data set attributes. As a side-effect, this introduces a test for the changes in #460. Co-authored-by: DiamondLightSource-build-server <DiamondLightSource-build-server@users.noreply.github.com> Co-authored-by: Richard Gildea <richard.gildea@diamond.ac.uk>
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.
Some NXmx data sources write single-valued data as length-1 1-d arrays, rather than as scalar data sets. A key offender is Dectris, who write lots of their Eiger metadata in this way. Squeeze all NXdetector properties to guard against malformed values.
Tests to follow in about a week's time when we can collect appropriate data.