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-beer/lib/python3.12/site-packages/scippneutron/chopper/disk_chopper.py:686: DimensionError
Full output
chopper_name = 'mca_chopper'
workflow = <sciline.pipeline.Pipeline object at 0x7f85c9485850>
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_beer_999999_00022387.hdf')
to_disk_choppers = <function _to_disk_choppers at 0x7f86239abec0>
check_disk_chopper = <function _check_disk_chopper at 0x7f85cbf31760>
@pytest.mark.parametrize(
"chopper_name",
["fc1a_chopper", "fc2a_chopper", "mca_chopper", "psc1_chopper", "psc2_chopper"],
)
def test_beer_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/beer/beer_load_nexus_test.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/nexusfiles-scipp/conftest.py:30: in _to_disk_choppers
key: DiskChopper.from_nexus(
.tox/nexusfiles-scipp-beer/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...ctor3 [m] (0, 0, 9.3), 'transform': <scipp.Variable> () translation3 [m] (0, 0, 9.3), ...}
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-beer/lib/python3.12/site-packages/scippneutron/chopper/disk_chopper.py:686: DimensionError