-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix issue with dims setup for NXdetector with event data #133
Conversation
NXdetector initialized the dims of the detector_number field, but NXdata subsequently called NXobject.__init__, which overrode this. Furthermore, the dim guessing logic ignored event-signals.
] | ||
|
||
|
||
def get_item_at_path(dg: sc.DataGroup, path: str) -> sc.DataArray: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks useful. Should this be turned into a method on NXdata
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note sure what you mean, scippnexus.Group
supports path-based access just like h5py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I mixed this up.
But it would also be useful on DataGroup
. I think someone mentioned this already...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I thought it felt like a bad idea?
return dg | ||
|
||
|
||
def assert_schema(dg: sc.DataGroup, schema: Dict[str, Any]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to use this for the 2 old tests as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I wanted to ensure that we can load the ESS files we care about correctly. Some of the older files are quite broken (we have open issues with ECDC), so this may not be so useful there since fallback to DataGroup is triggered in many cases.
NXdetector initialized the dims of the detector_number field, but NXdata subsequently called NXobject.init, which overrode this.
Furthermore, the dim guessing logic ignored event-signals.
After this, the AMOR file now correctly loads the NXdetector as a DataArray.