Skip to content

Commit 60f2cdd

Browse files
committed
add test for loading EmptyDetector
1 parent a91de7e commit 60f2cdd

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def tbl_registry() -> Registry:
6363
return make_registry(
6464
'ess/tbl',
6565
files={
66-
"857127_00000112_small.hdf": "md5:be5741892537a264c6f5df009a7c2881",
66+
"857127_00000112_small.hdf": "md5:0db89493b859dbb2f7354c3711ed7fbd",
6767
},
6868
version='2',
6969
)

tests/nexus/workflow_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
BackgroundRun,
1414
Beamline,
1515
EmptyBeamRun,
16+
EmptyDetector,
1617
Filename,
1718
FrameMonitor0,
1819
FrameMonitor1,
@@ -596,6 +597,20 @@ def test_load_histogram_detector_workflow(tbl_commissioning_orca_file: Path) ->
596597
assert da.ndim == 3
597598

598599

600+
def test_load_empty_histogram_detector_workflow(
601+
tbl_commissioning_orca_file: Path,
602+
) -> None:
603+
wf = LoadDetectorWorkflow(run_types=[SampleRun], monitor_types=[])
604+
wf[Filename[SampleRun]] = tbl_commissioning_orca_file
605+
wf[NeXusName[snx.NXdetector]] = 'orca_detector'
606+
da = wf.compute(EmptyDetector[SampleRun])
607+
assert 'position' in da.coords
608+
assert da.bins is None
609+
# The empty detector has no time dimension, only the dimensions of the geometry
610+
assert 'time' not in da.dims
611+
assert da.ndim == 2
612+
613+
599614
@pytest.mark.parametrize('preopen', [True, False])
600615
def test_generic_nexus_workflow(
601616
preopen: bool, loki_tutorial_sample_run_60250: Path

0 commit comments

Comments
 (0)