DMSC Integration Testing

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

Test: nexusfiles-scipp|bifrost|can_compute_tof|monitor_frame_3

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00017186.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:145: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:2344, ]
Coordinates:
* event_time_zero datetime64 ...event: 22300000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.

Examples
--------

>>> import scipp as sc
>>> var = sc.array(dims=['x', 'y'], values=[[1, 2], [3, 4]])
>>> var.rename_dims({'x': 'row', 'y': 'col'}).sizes
{'row': 2, 'col': 2}

Using keyword arguments:

>>> var.rename_dims(x='a', y='b').dims
('a', 'b')

Only specified dimensions are renamed:

>>> var.rename_dims(x='i').dims
('i', 'y')
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 2344).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00017046.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:145: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:1879, ]
Coordinates:
* event_time_zero datetime64 ...event: 17840000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.

Examples
--------

>>> import scipp as sc
>>> var = sc.array(dims=['x', 'y'], values=[[1, 2], [3, 4]])
>>> var.rename_dims({'x': 'row', 'y': 'col'}).sizes
{'row': 2, 'col': 2}

Using keyword arguments:

>>> var.rename_dims(x='a', y='b').dims
('a', 'b')

Only specified dimensions are renamed:

>>> var.rename_dims(x='i').dims
('i', 'y')
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 1879).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00016899.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:145: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:1418, ]
Coordinates:
* event_time_zero datetime64 ...event: 13473660),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.

Examples
--------

>>> import scipp as sc
>>> var = sc.array(dims=['x', 'y'], values=[[1, 2], [3, 4]])
>>> var.rename_dims({'x': 'row', 'y': 'col'}).sizes
{'row': 2, 'col': 2}

Using keyword arguments:

>>> var.rename_dims(x='a', y='b').dims
('a', 'b')

Only specified dimensions are renamed:

>>> var.rename_dims(x='i').dims
('i', 'y')
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 1418).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00016759.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:145: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:1410, ]
Coordinates:
* event_time_zero datetime64 ...event: 13380000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.

Examples
--------

>>> import scipp as sc
>>> var = sc.array(dims=['x', 'y'], values=[[1, 2], [3, 4]])
>>> var.rename_dims({'x': 'row', 'y': 'col'}).sizes
{'row': 2, 'col': 2}

Using keyword arguments:

>>> var.rename_dims(x='a', y='b').dims
('a', 'b')

Only specified dimensions are renamed:

>>> var.rename_dims(x='i').dims
('i', 'y')
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 1410).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00016626.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:145: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:1409, ]
Coordinates:
* event_time_zero datetime64 ...event: 13380000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.

Examples
--------

>>> import scipp as sc
>>> var = sc.array(dims=['x', 'y'], values=[[1, 2], [3, 4]])
>>> var.rename_dims({'x': 'row', 'y': 'col'}).sizes
{'row': 2, 'col': 2}

Using keyword arguments:

>>> var.rename_dims(x='a', y='b').dims
('a', 'b')

Only specified dimensions are renamed:

>>> var.rename_dims(x='i').dims
('i', 'y')
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 1409).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00016479.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:145: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:1876, ]
Coordinates:
* event_time_zero datetime64 ...event: 17840000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.

Examples
--------

>>> import scipp as sc
>>> var = sc.array(dims=['x', 'y'], values=[[1, 2], [3, 4]])
>>> var.rename_dims({'x': 'row', 'y': 'col'}).sizes
{'row': 2, 'col': 2}

Using keyword arguments:

>>> var.rename_dims(x='a', y='b').dims
('a', 'b')

Only specified dimensions are renamed:

>>> var.rename_dims(x='i').dims
('i', 'y')
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 1876).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00016339.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:145: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:1432, ]
Coordinates:
* event_time_zero datetime64 ...event: 13380000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.

Examples
--------

>>> import scipp as sc
>>> var = sc.array(dims=['x', 'y'], values=[[1, 2], [3, 4]])
>>> var.rename_dims({'x': 'row', 'y': 'col'}).sizes
{'row': 2, 'col': 2}

Using keyword arguments:

>>> var.rename_dims(x='a', y='b').dims
('a', 'b')

Only specified dimensions are renamed:

>>> var.rename_dims(x='i').dims
('i', 'y')
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 1432).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00016199.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:2377, ]
Coordinates:
* event_time_zero datetime64 ...event: 22300000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 2377).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00016059.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:2047, ]
Coordinates:
* event_time_zero datetime64 ...event: 19442032),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 2047).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00015919.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:2346, ]
Coordinates:
* event_time_zero datetime64 ...event: 22300000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 2346).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00015779.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:938, ]
Coordinates:
* event_time_zero datetime64 ...(event: 8920000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 938).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00015646.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:2392, ]
Coordinates:
* event_time_zero datetime64 ...event: 22678654),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 2392).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00015506.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
Dimensions: Sizes[event_time_zero:2817, ]
Coordinates:
* event_time_zero datetime64 ...event: 26760000),
data=float32[counts],
coords={'event_time_offset':int32[ns], 'event_id':int32})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 2817).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00014867.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
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})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 0).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00014867.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
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})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 0).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00014867.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
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})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 0).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00014867.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
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})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 0).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError

workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00014867.hdf')
monitor_type = ess.reduce.nexus.types.FrameMonitor3

@pytest.mark.parametrize(
"monitor_type",
[FrameMonitor1, FrameMonitor2, FrameMonitor3],
ids=["frame_1", "frame_2", "frame_3"],
)
def test_can_compute_tof__monitor_(
workflow: sciline.Pipeline, coda_nexus_file_path: Path, monitor_type: type
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[TimeOfFlightLookupTableFilename] = tof_lookup_table_simulation()
> result = workflow.compute(TofMonitor[SampleRun, monitor_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/nexusfiles-scipp/bifrost/bifrost_reduction_test.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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/spectroscopy/indirect/time_of_flight.py:84: in monitor_time_of_flight_data
monitor_data=monitor_data.rename(t='tof'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:115: in _rename_data_array
out = da.rename_dims(renaming_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
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})


dims_dict = {'t': 'tof'}, names = {}

def _rename_dims(
self: _T, dims_dict: IntoStrDict[str] | None = None, /, **names: str
) -> _T:
"""Rename dimensions.

The renaming can be defined:

- using a dict mapping the old to new names, e.g.
``rename_dims({'x': 'a', 'y': 'b'})``
- using keyword arguments, e.g. ``rename_dims(x='a', y='b')``

In both cases, x is renamed to a and y to b.

Dimensions not specified in either input are unchanged.

This function only renames dimensions.
See the ``rename`` method to also rename coordinates and attributes.

Parameters
----------
dims_dict:
Dictionary or items iterator mapping old to new names.
names:
Mapping of old to new names as keyword arguments.

Returns
-------
:
A new object with renamed dimensions.
"""
> return self._rename_dims(combine_dict_args(dims_dict, names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E scipp._scipp.core.DimensionError: Cannot rename dimension t since it is not contained in the input dimensions (event_time_zero: 0).

.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:45: DimensionError