workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00004620.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
Test: nexusfiles-scipp|bifrost|bifrost_read_monitor_data|FrameMonitor2
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00004475.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00004331.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00004187.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00004043.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00003908.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00003764.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00003629.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00003494.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:233: in load_nexus_component
nexus.load_component(location, nx_class=nx_class, definitions=definitions)
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:99: in load_component
with open_component_group(
/opt/miniforge/lib/python3.12/contextlib.py:137: in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:325: in open_component_group
yield _unique_child_group(parent, nx_class, group_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:370: in _unique_child_group
child = group[name]
^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00003359.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00003224.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00003080.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002945.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:270: in load_nexus_data
nexus.load_data(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:555: in load_data
component = instrument[component_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002801.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:233: in load_nexus_component
nexus.load_component(location, nx_class=nx_class, definitions=definitions)
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:99: in load_component
with open_component_group(
/opt/miniforge/lib/python3.12/contextlib.py:137: in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:325: in open_component_group
yield _unique_child_group(parent, nx_class, group_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:370: in _unique_child_group
child = group[name]
^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002792.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:233: in load_nexus_component
nexus.load_component(location, nx_class=nx_class, definitions=definitions)
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:99: in load_component
with open_component_group(
/opt/miniforge/lib/python3.12/contextlib.py:137: in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:325: in open_component_group
yield _unique_child_group(parent, nx_class, group_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:370: in _unique_child_group
child = group[name]
^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002616.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:233: in load_nexus_component
nexus.load_component(location, nx_class=nx_class, definitions=definitions)
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:99: in load_component
with open_component_group(
/opt/miniforge/lib/python3.12/contextlib.py:137: in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:325: in open_component_group
yield _unique_child_group(parent, nx_class, group_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:370: in _unique_child_group
child = group[name]
^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002553.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:233: in load_nexus_component
nexus.load_component(location, nx_class=nx_class, definitions=definitions)
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:99: in load_component
with open_component_group(
/opt/miniforge/lib/python3.12/contextlib.py:137: in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:325: in open_component_group
yield _unique_child_group(parent, nx_class, group_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:370: in _unique_child_group
child = group[name]
^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002544.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:233: in load_nexus_component
nexus.load_component(location, nx_class=nx_class, definitions=definitions)
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:99: in load_component
with open_component_group(
/opt/miniforge/lib/python3.12/contextlib.py:137: in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:325: in open_component_group
yield _unique_child_group(parent, nx_class, group_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:370: in _unique_child_group
child = group[name]
^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002530.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
> monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/task_graph.py:122: in compute
return self._scheduler.get(self._graph, [targets], reporter=reporter)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/scheduler.py:64: in get
results[t] = reporter.call_provider_with_reporting(graph[t], results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/reporter.py:398: in call_provider_with_reporting
return provider.call(values)
^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/sciline/_provider.py:144: in call
return self._func(
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:233: in load_nexus_component
nexus.load_component(location, nx_class=nx_class, definitions=definitions)
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:99: in load_component
with open_component_group(
/opt/miniforge/lib/python3.12/contextlib.py:137: in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:325: in open_component_group
yield _unique_child_group(parent, nx_class, group_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:370: in _unique_child_group
child = group[name]
^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
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: '097_frame_2'
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scippnexus/base.py:370: KeyError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002481.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002472.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002387.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002270.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002153.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00002036.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor2
check_monitor_data =
@pytest.mark.parametrize("monitor_type", [FrameMonitor1, FrameMonitor2, FrameMonitor3])
def test_bifrost_read_monitor_data(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
monitor_type: type,
check_monitor_data: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
monitor = workflow.compute(RawMonitor[SampleRun, monitor_type])
> check_monitor_data(monitor)
tests/nexusfiles-scipp/bifrost/bifrost_load_nexus_test.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
da =
Dimensions: Sizes[event_time_zero:0, ]
Coordinates:
* event_time_zero datetime64 ... dims=(event: 0),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})
def _check_monitor_data(da: sc.DataArray) -> None:
if da.bins is not None:
assert da.dims == ("event_time_zero",)
assert "event_time_offset" in da.bins.coords
> assert da.bins.size().sum().value > 0
E AssertionError: assert np.int64(0) > 0
E + where np.int64(0) =
E + where
E + where sum =
E + where
E + where size =
E + where
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/validation_fixtures.py:38: AssertionError