View job log here
scipp._scipp.core.DimensionError: Chopper field 'rotation_speed_setpoint' must be a scalar variable, got a 1d variable. See the chopper user-guide for more information: https://scipp.github.io/scippneutron/user-guide/chopper/processing-nexus-choppers.html
.tox/nexusfiles-scipp-dream/lib/python3.12/site-packages/scippneutron/chopper/disk_chopper.py:686: DimensionError
Full output
chopper_name = 'overlap_chopper'
workflow = <sciline.pipeline.Pipeline object at 0x7efbf528b620>
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_dream_999999_00022379.hdf')
to_disk_choppers = <function _to_disk_choppers at 0x7efc631e85e0>
check_disk_chopper = <function _check_disk_chopper at 0x7efc0b731940>
@pytest.mark.parametrize(
"chopper_name",
[
"T0_chopper",
"band_chopper",
"overlap_chopper",
"pulse_shaping_chopper1",
"pulse_shaping_chopper2",
],
)
def test_dream_read_choppers_to_disk_choppers(
chopper_name: str,
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
to_disk_choppers: Callable,
check_disk_chopper: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
choppers = workflow.compute(RawChoppers[SampleRun])
> disk_choppers = to_disk_choppers({chopper_name: choppers[chopper_name]})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/dream/dream_load_nexus_test.py:162:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/nexusfiles-scipp/conftest.py:30: in _to_disk_choppers
key: DiskChopper.from_nexus(
.tox/nexusfiles-scipp-dream/lib/python3.12/site-packages/scippneutron/chopper/disk_chopper.py:352: in from_nexus
frequency = _get_0d_variable(chopper, 'rotation_speed_setpoint')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dg = {'beam_position': <scipp.Variable> () float64 [deg] 0, 'type': <DiskChopperType.single: 'Chopper type s...35, 0.1435, -70.376), 'transform': <scipp.Variable> () translation3 [m] (-0.1435, 0.1435, -70.376), ...}
name = 'rotation_speed_setpoint'
def _get_0d_variable(
dg: Mapping[str, sc.Variable | sc.DataArray], name: str
) -> sc.Variable:
if (val := dg.get(name)) is None:
raise ValueError(f"Chopper field '{name}' is missing")
msg = (
"Chopper field '{name}' must be a scalar variable, {got}. "
"See the chopper user-guide for more information: "
"https://scipp.github.io/scippneutron/user-guide/chopper/processing-nexus-choppers.html"
)
if isinstance(val, sc.DataArray):
val = val.data
if not isinstance(val, sc.Variable):
raise TypeError(msg.format(name=name, got=f'got a {type(val)}'))
val = val.squeeze()
if val.ndim != 0:
> raise sc.DimensionError(
msg.format(name=name, got=f'got a {val.ndim}d variable')
)
E scipp._scipp.core.DimensionError: Chopper field 'rotation_speed_setpoint' must be a scalar variable, got a 1d variable. See the chopper user-guide for more information: https://scipp.github.io/scippneutron/user-guide/chopper/processing-nexus-choppers.html
.tox/nexusfiles-scipp-dream/lib/python3.12/site-packages/scippneutron/chopper/disk_chopper.py:686: DimensionError