scipp / scippnexus

h5py-like utility for NeXus files with seamless scipp integration
https://scipp.github.io/scippnexus/
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

More selective fallback loader #107

Closed jl-wynen closed 1 year ago

jl-wynen commented 1 year ago

Currently, the fallback loader in NXobject catches (nearly) all exceptions from loaders for concrete classes and uses the fallback. This is intended to allow loading files with partially bad structure. But it also hides user errors like a bad index (wrong dim, bad slice, etc.).

We should distinguish between errors originating in the file structure and error originating from the user/caller. Only the former should trigger the fallback.

SimonHeybrock commented 1 year ago

We are already making use of scippnexus.NexusStructureError in a number of places. Structure errors are exactly what the fallback is about, so maybe we can use that more consistently?