workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00023346.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:2162, ]
Coordinates:
* event_time_zero datetime64 ...event: 20507080),
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: 2162).
.tox/nexusfiles-scipp-bifrost/lib/python3.12/site-packages/scipp/core/dimensions.py:63: DimensionError
Test: nexusfiles-scipp|bifrost|can_compute_tof|monitor_frame_3
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_bifrost_999999_00023206.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:2351, ]
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: 2351).
.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_00023066.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:1411, ]
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: 1411).
.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_00022919.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:2574, ]
Coordinates:
* event_time_zero datetime64 ...event: 24405120),
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: 2574).
.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_00022771.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:1732, ]
Coordinates:
* event_time_zero datetime64 ...event: 16408340),
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: 1732).
.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_00022638.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:713, ]
Coordinates:
* event_time_zero datetime64 ...(event: 6756008),
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: 713).
.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_00022458.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:1408, ]
Coordinates:
* event_time_zero datetime64 ...event: 13309532),
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: 1408).
.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_00022318.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:1890, ]
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: 1890).
.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_00022178.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:1413, ]
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: 1413).
.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_00022031.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:1882, ]
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: 1882).
.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_00021891.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:1411, ]
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: 1411).
.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_00021758.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:1412, ]
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: 1412).
.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_00021478.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:2824, ]
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.
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: 2824).
.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_00021338.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:1886, ]
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: 1886).
.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_00021198.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:2353, ]
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: 2353).
.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_00021058.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:1885, ]
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: 1885).
.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_00020918.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:1885, ]
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: 1885).
.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_00020778.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:958, ]
Coordinates:
* event_time_zero datetime64 ...(event: 9031500),
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: 958).
.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_00020733.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:940, ]
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.
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: 940).
.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_00020733.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:940, ]
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.
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: 940).
.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_00020726.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:2390, ]
Coordinates:
* event_time_zero datetime64 ...event: 22606402),
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: 2390).
.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_00020586.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:1282, ]
Coordinates:
* event_time_zero datetime64 ...event: 12184720),
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: 1282).
.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_00020446.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:1413, ]
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: 1413).
.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_00020306.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:2353, ]
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: 2353).
.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_00020158.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:1885, ]
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: 1885).
.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_00020018.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:2428, ]
Coordinates:
* event_time_zero datetime64 ...event: 22990854),
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: 2428).
.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_00019885.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:1887, ]
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: 1887).
.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_00019740.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:1885, ]
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: 1885).
.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_00019600.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:1413, ]
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: 1413).
.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_00019460.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:2143, ]
Coordinates:
* event_time_zero datetime64 ...event: 20263564),
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: 2143).
.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_00019313.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:1882, ]
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: 1882).
.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_00019180.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:2139, ]
Coordinates:
* event_time_zero datetime64 ...event: 20283188),
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: 2139).
.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_00019033.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:2117, ]
Coordinates:
* event_time_zero datetime64 ...event: 20102112),
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: 2117).
.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_00018886.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:1877, ]
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: 1877).
.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_00018746.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:1398, ]
Coordinates:
* event_time_zero datetime64 ...event: 13289908),
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: 1398).
.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_00018606.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:1883, ]
Coordinates:
* event_time_zero datetime64 ...event: 17873450),
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: 1883).
.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_00018459.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:2317, ]
Coordinates:
* event_time_zero datetime64 ...event: 21983786),
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: 2317).
.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_00018319.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:1882, ]
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: 1882).
.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_00018235.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:1556, ]
Coordinates:
* event_time_zero datetime64 ...event: 14798726),
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: 1556).
.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_00018235.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:1556, ]
Coordinates:
* event_time_zero datetime64 ...event: 14798726),
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: 1556).
.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_00018186.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:2810, ]
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.
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: 2810).
.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_00018046.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:2152, ]
Coordinates:
* event_time_zero datetime64 ...event: 20492808),
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: 2152).
.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_00017899.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:1407, ]
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: 1407).
.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_00017759.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:941, ]
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.
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: 941).
.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_00017613.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:2345, ]
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: 2345).
.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_00017473.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_00017333.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_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