DMSC Integration Testing

Last updated: February 03, 2026 06:02:03

Test: nexusfiles-scipp|odin|odin_validate_exposure_time|orca

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00017191.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00017044.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00016904.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00016764.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00016624.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00016484.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00016337.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00016197.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00016057.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00015917.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00015784.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00015644.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00015504.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014865.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014865.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014865.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014865.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014865.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:361: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:367: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014816.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014536.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014395.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014255.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00014115.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00013968.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00013828.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00013683.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00013550.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_odin_999999_00013410.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011148.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00011071.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00010938.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00010805.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00010672.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/odin_999999_00010532.hdf')

def test_odin_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
"""Test that the exposure_time dataset in the ORCA detector is valid.

We need `exposure_time` of each image frame to normalize the histogram data.
It is not part of `GenericWorkflow` so we test it manually here.
Assuming `exposure_time` is not changed during a measurement,
it should be a single value dataset.
"""
# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/histogram_mode_detectors/orca/exposure_time"
# We are using `ess.reduce.nexus.open_nexus_file` here
# due to file locking issue.
# See https://github.com/scipp/essreduce/issues/287.
with open_nexus_file(coda_nexus_file_path) as f:
> exposure_time_data: sc.Variable = f[exposure_time_path][()]
^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/odin/odin_load_nexus_test.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , sel = 'exposure_time'

def __getitem__(self, sel):
"""
Get a child group or child dataset, a selection of child groups, or load and
return the current group.

Three cases are supported:

- String name: The child group or child dataset of that name is returned.
- Class such as ``NXdata`` or ``NXlog``: A dict containing all direct children
with a matching ``NX_class`` attribute are returned. Also accepts a tuple of
classes. ``Field`` selects all child fields, i.e., all datasets but not
groups.
- Scipp-style index: Load the specified slice of the current group, returning
a :class:`scipp.DataArray` or :class:`scipp.DataGroup`.

Parameters
----------
sel:
Child name, class, or index.

Returns
-------
:
Field, group, dict of fields, or loaded data.
"""
if isinstance(sel, str):
# We cannot get the child directly from the HDF5 group, since we need to
# create the parent group, to ensure that fields get the correct properties
# such as sizes and dtype.
if '/' in sel:
sel_path = PurePosixPath(sel)
if sel_path.is_absolute():
return self.file[sel_path.relative_to('/').as_posix()]
# If the path is a single name, we can directly access the child
elif len(sel_path.parts) == 1:
return self[sel_path.as_posix()]
else:
grp = sel_path.parts[0]
return self[grp][sel_path.relative_to(grp).as_posix()]
elif sel == '..':
return self.parent
> child = self._children[sel]
^^^^^^^^^^^^^^^^^^^
E KeyError: 'exposure_time'

.tox/nexusfiles-scipp-odin/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError