workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00084396.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00084396.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
Test: nexusfiles-scipp|tbl|tbl_read_detector_data|orca_detector
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00084263.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00084263.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00084123.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00084123.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083994.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083994.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
instrument = 'tbl', coda_proposal_id = '999999'
pathfinder =
@pytest.fixture(scope="session")
def coda_nexus_file_path(
instrument: str, coda_proposal_id: str, pathfinder: Callable[..., Path]
) -> Path:
> return pathfinder(proposal_id=coda_proposal_id, instrument=instrument)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:34: in
"manual": lambda *args, **kwargs: coda.get_latest_nexus_paths(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instrument = 'Test Beamline Multiblade', proposal_id = '999999', n = 1
inspect = 20
def get_latest_nexus_paths(
instrument: str, proposal_id: str | None, n: int = 1, inspect: int = 20
) -> list[Path]:
"""
Get the latest file paths manually by sorting the files in the directory.
Parameters
----------
instrument:
The instrument name.
proposal_id:
SciCat proposal ID for CODA.
If ``None``, the environment variable ``OVERRIDE_RAW_DATA_DIR`` must be set.
n:
The number of files to return.
inspect:
The number of files to inspect before returning.
Returns
-------
:
Paths to the n latest files for the given instrument and proposal.
"""
instrument = NEXUS_INSTRUMENT_NAME[instrument]
path = _coda_raw_data_path(proposal_id)
files_found = []
logging.info(
"Scanning the %d latest files in %s for instrument %s",
inspect,
path,
instrument,
)
recent_files = sorted(path.glob("*.hdf"))[-inspect::][::-1]
logging.info("Recent files: %s", recent_files)
for file in recent_files:
logging.info("Inspecting file: %s", file)
try:
with snx.File(file, "r", locking=False) as f:
instrument_in_file = f["/entry/instrument/name"][()]
if instrument_in_file == instrument:
logging.info(
"File %s matches requested instrument %s. Adding to list. "
"Last modified: %s",
file,
instrument,
datetime.fromtimestamp(
os.stat(file).st_mtime, tz=local_timezone()
),
)
files_found.append(file)
if len(files_found) == n:
logging.info("Found %d files. Returning.", n)
return files_found
else:
logging.info(
"File instrument is %s, but %s was requested. Skipping.",
instrument_in_file,
instrument,
)
except OSError as e:
logging.warning(
"File %s could not be opened. Reason: %s",
file,
e,
)
continue
logging.error("No files found for instrument %s", instrument)
> raise RuntimeError(f"No files found for instrument {instrument}")
E RuntimeError: No files found for instrument Test Beamline Multiblade
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/nexusfiles/coda.py:94: RuntimeError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083735.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083735.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083602.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083602.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083469.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083469.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083343.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083343.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083210.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083210.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083077.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00083077.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00082958.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00082958.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00082825.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/999999/raw/999999_00082825.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
instrument = 'tbl', coda_proposal_id = '977695'
pathfinder =
@pytest.fixture(scope="session")
def coda_nexus_file_path(
instrument: str, coda_proposal_id: str, pathfinder: Callable[..., Path]
) -> Path:
> return pathfinder(proposal_id=coda_proposal_id, instrument=instrument)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:34: in
"manual": lambda *args, **kwargs: coda.get_latest_nexus_paths(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instrument = 'Test Beamline Multiblade', proposal_id = '977695', n = 1
inspect = 20
def get_latest_nexus_paths(
instrument: str, proposal_id: str | None, n: int = 1, inspect: int = 20
) -> list[Path]:
"""
Get the latest file paths manually by sorting the files in the directory.
Parameters
----------
instrument:
The instrument name.
proposal_id:
SciCat proposal ID for CODA.
If ``None``, the environment variable ``OVERRIDE_RAW_DATA_DIR`` must be set.
n:
The number of files to return.
inspect:
The number of files to inspect before returning.
Returns
-------
:
Paths to the n latest files for the given instrument and proposal.
"""
instrument = NEXUS_INSTRUMENT_NAME[instrument]
path = _coda_raw_data_path(proposal_id)
files_found = []
logging.info(
"Scanning the %d latest files in %s for instrument %s",
inspect,
path,
instrument,
)
recent_files = sorted(path.glob("*.hdf"))[-inspect::][::-1]
logging.info("Recent files: %s", recent_files)
for file in recent_files:
logging.info("Inspecting file: %s", file)
try:
with snx.File(file, "r", locking=False) as f:
instrument_in_file = f["/entry/instrument/name"][()]
if instrument_in_file == instrument:
logging.info(
"File %s matches requested instrument %s. Adding to list. "
"Last modified: %s",
file,
instrument,
datetime.fromtimestamp(
os.stat(file).st_mtime, tz=local_timezone()
),
)
files_found.append(file)
if len(files_found) == n:
logging.info("Found %d files. Returning.", n)
return files_found
else:
logging.info(
"File instrument is %s, but %s was requested. Skipping.",
instrument_in_file,
instrument,
)
except OSError as e:
logging.warning(
"File %s could not be opened. Reason: %s",
file,
e,
)
continue
logging.error("No files found for instrument %s", instrument)
> raise RuntimeError(f"No files found for instrument {instrument}")
E RuntimeError: No files found for instrument Test Beamline Multiblade
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/nexusfiles/coda.py:94: RuntimeError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082356.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082356.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082356.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082356.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082296.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082296.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082164.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082164.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082038.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00082038.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081906.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081906.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081648.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081648.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081522.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081522.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081396.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081396.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081258.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081258.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081132.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081132.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081006.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00081006.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080880.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080880.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080736.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080736.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080598.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080598.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080460.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080460.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
workflow =
coda_nexus_file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080316.hdf')
check_detector_histogram =
def test_tbl_read_detector_data__orca_detector(
workflow: sciline.Pipeline,
coda_nexus_file_path: Path,
check_detector_histogram: Callable,
) -> None:
workflow[Filename[SampleRun]] = coda_nexus_file_path
workflow[NeXusDetectorName] = "orca_detector"
> result = workflow.compute(NeXusData[NXdetector, SampleRun])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/nexusfiles-scipp/tbl/tbl_load_nexus_test.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/sciline/pipeline.py:191: in compute
return self.get(tp, **kwargs).compute(reporter=reporter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/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-tbl/lib/python3.12/site-packages/sciline/scheduler.py:119: in get
return self._dask_get(dsk, list(map(_to_dask_key, keys)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/threaded.py:91: in get
results = get_async(
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:549: in get_async
raise_exception(exc, tb)
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:353: in reraise
raise exc
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/local.py:258: in execute_task
result = task(data)
^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/_task_spec.py:759: in __call__
return self.func(*new_argspec)
^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dask/utils.py:80: in apply
return func(*args)
^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/workflow.py:267: in load_nexus_data
nexus.load_data(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
file_path = PosixPath('/ess/data/coda/2025/977695/raw/977695_00080316.hdf')
selection = slice(None, None, None)
def load_data(
file_path: FilePath | NeXusFile | NeXusGroup,
selection: snx.typing.ScippIndex | slice = (),
*,
entry_name: NeXusEntryName | None = None,
component_name: str,
definitions: Mapping | NoNewDefinitionsType = NoNewDefinitions,
) -> sc.DataArray:
"""Load data of a detector or monitor from a NeXus file.
Loads either event data from an ``NXevent_data`` group or histogram
data from an ``NXdata`` group depending on which ``group`` contains.
Event data is grouped by ``'event_time_zero'`` as in the NeXus file.
Histogram data is returned as encoded in the file.
Parameters
----------
file_path:
Indicates where to load data from.
One of:
- Path to a NeXus file on disk.
- File handle or buffer for reading binary data.
- A ScippNexus group of the root of a NeXus file.
selection:
Select which aprt of the data to load.
By default, load all data.
Supports anything that ScippNexus supports.
component_name:
Name of the NXdetector or NXmonitor containing the NXevent_data to load.
Must be a group in an instrument group in the entry (see below).
entry_name:
Name of the entry that contains the detector.
If ``None``, the entry will be located based
on its NeXus class, but there cannot be more than 1.
definitions:
Definitions used by scippnexus loader, see :py:`scippnexus.File`
for documentation.
Returns
-------
:
Data array with events or a histogram.
"""
with open_nexus_file(file_path, definitions=definitions) as f:
entry = _unique_child_group(f, snx.NXentry, entry_name)
instrument = _unique_child_group(entry, snx.NXinstrument, None)
component = instrument[component_name]
if _contains_nx_class(component, snx.NXevent_data):
data = _unique_child_group(component, snx.NXevent_data, None)
sel = _to_snx_selection(selection, for_events=True)
elif _contains_nx_class(component, snx.NXdata):
data = _unique_child_group(component, snx.NXdata, None)
sel = _to_snx_selection(selection, for_events=False)
else:
> raise ValueError(
f"NeXus group '{component.name}' contains neither "
"NXevent_data nor NXdata."
)
E ValueError: NeXus group '/entry/instrument/orca_detector' contains neither NXevent_data nor NXdata.
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/ess/reduce/nexus/_nexus_loader.py:371: ValueError
instrument = 'tbl', coda_proposal_id = '977695'
pathfinder =
@pytest.fixture(scope="session")
def coda_nexus_file_path(
instrument: str, coda_proposal_id: str, pathfinder: Callable[..., Path]
) -> Path:
> return pathfinder(proposal_id=coda_proposal_id, instrument=instrument)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:34: in
"manual": lambda *args, **kwargs: coda.get_latest_nexus_paths(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
instrument = 'Test Beamline Multiblade', proposal_id = '977695', n = 1
inspect = 20
def get_latest_nexus_paths(
instrument: str, proposal_id: str | None, n: int = 1, inspect: int = 20
) -> list[Path]:
"""
Get the latest file paths manually by sorting the files in the directory.
Parameters
----------
instrument:
The instrument name.
proposal_id:
SciCat proposal ID for CODA.
If ``None``, the environment variable ``OVERRIDE_RAW_DATA_DIR`` must be set.
n:
The number of files to return.
inspect:
The number of files to inspect before returning.
Returns
-------
:
Paths to the n latest files for the given instrument and proposal.
"""
instrument = NEXUS_INSTRUMENT_NAME[instrument]
path = _coda_raw_data_path(proposal_id)
files_found = []
logging.info(
"Scanning the %d latest files in %s for instrument %s",
inspect,
path,
instrument,
)
recent_files = sorted(path.glob("*.hdf"))[-inspect::][::-1]
logging.info("Recent files: %s", recent_files)
for file in recent_files:
logging.info("Inspecting file: %s", file)
try:
with snx.File(file, "r", locking=False) as f:
instrument_in_file = f["/entry/instrument/name"][()]
if instrument_in_file == instrument:
logging.info(
"File %s matches requested instrument %s. Adding to list. "
"Last modified: %s",
file,
instrument,
datetime.fromtimestamp(
os.stat(file).st_mtime, tz=local_timezone()
),
)
files_found.append(file)
if len(files_found) == n:
logging.info("Found %d files. Returning.", n)
return files_found
else:
logging.info(
"File instrument is %s, but %s was requested. Skipping.",
instrument_in_file,
instrument,
)
except OSError as e:
logging.warning(
"File %s could not be opened. Reason: %s",
file,
e,
)
continue
logging.error("No files found for instrument %s", instrument)
> raise RuntimeError(f"No files found for instrument {instrument}")
E RuntimeError: No files found for instrument Test Beamline Multiblade
.tox/nexusfiles-scipp-tbl/lib/python3.12/site-packages/dmsc_nightly/nexusfiles/coda.py:94: RuntimeError