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-freia/lib/python3.12/site-packages/scippneutron/chopper/disk_chopper.py:686: DimensionError
Full output
chopper_name = 'FOC-2_chopper'
workflow = <sciline.pipeline.Pipeline object at 0x7fe5f6278740>
coda_nexus_file_path = PosixPath('/ess/data/coda/999999/raw/coda_freia_999999_00022381.hdf')
to_disk_choppers = <function _to_disk_choppers at 0x7fe6a56ac5e0>
check_disk_chopper = <function _check_disk_chopper at 0x7fe64da91940>
@pytest.mark.parametrize(
"chopper_name",
[
"FOC-1_chopper",
"FOC-2_chopper",
"FOC-3_chopper",
"WBC-1_chopper",
"WBC-2_chopper",
"WBC-3_chopper",
"WFM-1_chopper",
"WFM-2_chopper",
],
)
def test_freia_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/freia/freia_load_nexus_test.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/nexusfiles-scipp/conftest.py:30: in _to_disk_choppers
key: DiskChopper.from_nexus(
.tox/nexusfiles-scipp-freia/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...iable> () vector3 [m] (0, 0, 0), 'transform': <scipp.Variable> () int64 [dimensionless] 1, ...}
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-freia/lib/python3.12/site-packages/scippneutron/chopper/disk_chopper.py:686: DimensionError