-
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
Big rewrite #117
Big rewrite #117
Conversation
Add error handling Fix reading of fields Add NXobject subclass handling Refactor for more automatic child handling Introduce multiple map layers, I think this does not work Refactor to new approach Customize field dims via strategy Refactor Rename Basic NXdata support Cleanup Absorb errors handling into Field Cleanup Allow for dtype override Pass (base) definitions from parents Translate sel for children Bin-edge handling Undo change to unrelated file
Should be ready for another review @jl-wynen. |
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.
I have gone through all files now.
This reverts commit 77e2d7c.
Tracking next steps in #120. |
@jl-wynen I fixed another small issue, and pushed some extra horrible code to deal with event-data fields embedded in |
I believe this was added in #117 when considering to not group by pixel during loading. In the end that was not the chosen solution, but apparently I forgot to remove this now unused helper.
This adds, as
scippnexus.v2
, the future version of ScippNexus. The trigger for this rewrite were significant performance issues with small files that contain thousands of groups and datasets. However, it also attempts to resolve some complicated logic of the old implementation, which did lead, e.g., to hard to understand stack traces in exceptions.To use this, just try
import scippnexus.v2 as snx
. The basic API is the same as before.Apart from internal design and significant performance improvements (not affecting large datasets), there are a number of changes:
DataGroup
is not better at preserving "partial" information, if assembly fails.NX*geometry
classes are loaded asDataGroup
without processing. We will provide post-processing functions for grouping this bydetector_number
, etc.NXevent_data
is not automatically grouped bydetector_number
. There is a post-processing function for this, but we will need to add some that operate recursively.For review:
base.py
.class File
and its helper functions are mostly (but not completely) unchanged.nxdata.py
.nxtransformations.py
, which I plan to refactor in a follow-up into a couple of user-facing functions for resolving and executingdepends_on
-chains.Bugfixes:
shape=(0,)
are now correctly loaded as datetime if they should. Previously this always returned a time (offset).shape=(0,)
are now correctly loaded as transformation if they should. Previously this always returned the plain value of the transformation.