Skip to content
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

Merged
merged 4 commits into from
Apr 20, 2023

Conversation

SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Apr 19, 2023

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.

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:
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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...

Copy link
Member Author

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:
Copy link
Member

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?

Copy link
Member Author

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.

Base automatically changed from axis-fix to main April 20, 2023 08:59
@SimonHeybrock SimonHeybrock merged commit f38f9df into main Apr 20, 2023
@SimonHeybrock SimonHeybrock deleted the fix-event-field-dims-setup branch April 20, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants