DMSC Integration Testing

Last updated: December 17, 2025 22:42:25

Test: nexusfiles-scipp|tbl|tbl_validate_exposure_time|orca

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

instrument = 'tbl', coda_proposal_id = '999999'
pathfinder = . at 0x7f23bfb9b380>

@pytest.fixture(scope="session")
def coda_nexus_file_path(
instrument: str, coda_proposal_id: str, pathfinder: Callable[..., Path]
) -> Path:
> return pathfinder(proposal_id=coda_proposal_id, instrument=instrument)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:29: in
"manual": lambda *args, **kwargs: coda.get_latest_nexus_paths(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

instrument = 'tbl', proposal_id = '999999', n = 1

@cache
def get_latest_nexus_paths(
instrument: str, proposal_id: str | None, n: int = 1
) -> list[Path]:
"""
Get the latest file paths manually by sorting the files in the directory.

Parameters
----------
instrument:
The instrument name.
proposal_id:
SciCat proposal ID for CODA.
If ``None``, the environment variable ``OVERRIDE_RAW_DATA_DIR`` must be set.
n:
Return up to n files.

Returns
-------
:
Paths to the n latest files for the given instrument and proposal.
"""
base_path = _coda_raw_data_path(proposal_id)
glob = _RAW_FILE_GLOB_PATTERN.format(instrument=instrument)
logging.info(
"Searching for files for instrument %s in %s with glob %s",
instrument,
base_path,
glob,
)

# Note that this gets the ctime of _all_ files matching the glob.
recent_files = sorted(base_path.glob(glob), key=get_ctime)[::-1]
if not recent_files:
logging.error("No files found for instrument %s", instrument)
raise RuntimeError(f"No files found for instrument {instrument}")

openable_files = _first_n_openable_files(recent_files, n)
if not openable_files:
logging.error("No files found for instrument %s that can be opened", instrument)
> raise RuntimeError(
f"No files found for instrument {instrument} that can be opened"
)
E RuntimeError: No files found for instrument tbl that can be opened

.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/nexusfiles/coda.py:73: RuntimeError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:213:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_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/orca_detector/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/tbl/tbl_load_nexus_test.py:219:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:356: in __getitem__
return self.file[sel_path.relative_to('/').as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/base.py:362: in __getitem__
return self[grp][sel_path.relative_to(grp).as_posix()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/scippnexus/base.py:365: KeyError

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

def test_tbl_validate_exposure_time__orca(coda_nexus_file_path: FilePath) -> None:
# 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.
import scipp as sc
from ess.reduce.nexus import open_nexus_file

# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/orca_detector/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:
> assert exposure_time_path in f
E AssertionError: assert '/entry/instrument/orca_detector/exposure_time' in

tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:217: AssertionError

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

def test_tbl_validate_exposure_time__orca(coda_nexus_file_path: Path) -> None:
# 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.
import scipp as sc
import scippnexus as snx

# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/orca_detector/exposure_time"
> with snx.File(coda_nexus_file_path) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:212:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/file.py:51: in __init__
self._file = h5py.File(name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/h5py/_hl/files.py:564: in __init__
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/h5py/_hl/files.py:238: in make_fid
fid = h5f.open(name, flags, fapl=fapl)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
h5py/_objects.pyx:56: in h5py._objects.with_phil.wrapper
???
h5py/_objects.pyx:57: in h5py._objects.with_phil.wrapper
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

> ???
E OSError: [Errno 30] Unable to synchronously open file (unable to lock file, errno = 30, error message = 'Read-only file system')

h5py/h5f.pyx:102: OSError

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

def test_tbl_validate_exposure_time__orca(coda_nexus_file_path: Path) -> None:
# 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.
import scipp as sc
import scippnexus as snx

# This is a temporary path until we know where it will be placed in the NeXus file.
exposure_time_path = "/entry/instrument/orca_detector/exposure_time"
> with snx.File(coda_nexus_file_path, "r") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:212:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/scippnexus/file.py:51: in __init__
self._file = h5py.File(name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/h5py/_hl/files.py:564: in __init__
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/h5py/_hl/files.py:238: in make_fid
fid = h5f.open(name, flags, fapl=fapl)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
h5py/_objects.pyx:56: in h5py._objects.with_phil.wrapper
???
h5py/_objects.pyx:57: in h5py._objects.with_phil.wrapper
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

> ???
E OSError: [Errno 30] Unable to synchronously open file (unable to lock file, errno = 30, error message = 'Read-only file system')

h5py/h5f.pyx:102: OSError