Skip to content
Snippets Groups Projects
Commit 900c9d05 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Try adding test for missing constant but module 'present'

parent 1ed72b68
No related branches found
No related tags found
1 merge request!885Revised CalCat API
...@@ -4,6 +4,7 @@ from cal_tools.calcat_interface2 import ( ...@@ -4,6 +4,7 @@ from cal_tools.calcat_interface2 import (
CalibrationData, CalibrationData,
AGIPDConditions, AGIPDConditions,
DSSCConditions, DSSCConditions,
LPDConditions,
SingleConstantVersion, SingleConstantVersion,
) )
...@@ -67,11 +68,27 @@ def test_DSSC_modules_missing(): ...@@ -67,11 +68,27 @@ def test_DSSC_modules_missing():
) )
# DSSC was used with only 3 quadrants at this point # DSSC was used with only 3 quadrants at this point
modnos = list(range(4)) + list(range(8, 16)) modnos = list(range(4)) + list(range(8, 16))
assert dssc_cd.aggregator_names == [f'DSSC{m:02}' for m in modnos] assert dssc_cd.aggregator_names == [f"DSSC{m:02}" for m in modnos]
assert dssc_cd.module_nums == modnos assert dssc_cd.module_nums == modnos
assert dssc_cd.qm_names == [ assert dssc_cd.qm_names == [f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos]
f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos
]
@pytest.mark.requires_gpfs
def test_LPD_constant_missing():
lpd_cd = CalibrationData.from_condition(
LPDConditions(memory_cells=200, sensor_bias_voltage=250),
"FXE_DET_LPD1M-1",
event_at="2022-05-22T02:00:00",
)
# Constants are missing for 1 module (LPD05), but it was still included in
# the PDUs for the detector, so it should still appear in the lists.
modnos = range(16)
assert lpd_cd.aggregator_names == [f"DSSC{m:02}" for m in modnos]
assert lpd_cd.module_nums == modnos
assert lpd_cd.qm_names == [f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos]
assert len(lpd_cd["Offset"].module_nums) == 16
assert len(lpd_cd["Offset"].constants) == 15
@pytest.mark.xfail @pytest.mark.xfail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment