DMSC Integration Testing

Last updated: December 17, 2025 22:42:25

Test: nexusfiles-scipp|loki|loki_read_component_position|source_position

None

None

None

None

None

None

None

None

None

None

None

None

instrument = 'loki', coda_proposal_id = '999999'
pathfinder = . at 0x7fe822632ca0>

@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-loki/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nexusfiles-scipp-loki/lib/python3.12/site-packages/dmsc_nightly/testing/nexusfiles/setup_fixtures.py:29: in
"manual": lambda *args, **kwargs: coda.get_latest_nexus_paths(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

instrument = 'loki', proposal_id = '999999', n = 1

@cache
def get_latest_nexus_paths(
instrument: str, proposal_id: str | None, n: int = 1
) -> 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:
Return up to n files.

Returns
-------
:
Paths to the n latest files for the given instrument and proposal.
"""
base_path = _coda_raw_data_path(proposal_id)
glob = _RAW_FILE_GLOB_PATTERN.format(instrument=instrument)
logging.info(
"Searching for files for instrument %s in %s with glob %s",
instrument,
base_path,
glob,
)

# Note that this gets the ctime of _all_ files matching the glob.
recent_files = sorted(base_path.glob(glob), key=get_ctime)[::-1]
if not recent_files:
logging.error("No files found for instrument %s", instrument)
raise RuntimeError(f"No files found for instrument {instrument}")

openable_files = _first_n_openable_files(recent_files, n)
if not openable_files:
logging.error("No files found for instrument %s that can be opened", instrument)
> raise RuntimeError(
f"No files found for instrument {instrument} that can be opened"
)
E RuntimeError: No files found for instrument loki that can be opened

.tox/nexusfiles-scipp-loki/lib/python3.12/site-packages/dmsc_nightly/nexusfiles/coda.py:73: RuntimeError

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None