File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
pioreactor/background_jobs Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 6262from pioreactor import whoami
6363from pioreactor .background_jobs .base import BackgroundJob
6464from pioreactor .background_jobs .base import LoggerMixin
65- from pioreactor .calibrations import load_active_calibration
6665from pioreactor .config import config
6766from pioreactor .pubsub import publish
6867from pioreactor .states import JobState as st
@@ -1417,6 +1416,8 @@ def start_od_reading(
14171416 # use an OD calibration?
14181417 calibration_transformer : CalibrationTransformerProtocol
14191418 if calibration is True :
1419+ from pioreactor .calibrations import load_active_calibration
1420+
14201421 calibration_transformer = CachedCalibrationTransformer ()
14211422 for channel , angle in channel_angle_map .items ():
14221423 active_calibration = load_active_calibration (f"od{ angle } " ) # type: ignore
Original file line number Diff line number Diff line change @@ -1453,6 +1453,29 @@ def test_can_pass_config_section_directly() -> None:
14531453 assert set (od .channel_angle_map .keys ()) == {"1" }
14541454
14551455
1456+ def test_config_section_omits_empty_photodiode_channels () -> None :
1457+ experiment = "test_config_section_omits_empty_photodiode_channels"
1458+ with temporary_config_changes (
1459+ config ,
1460+ [
1461+ ("od_config.photodiode_channel" , "1" , "REF" ),
1462+ ("od_config.photodiode_channel" , "2" , "90" ),
1463+ ("od_config.photodiode_channel" , "3" , "" ),
1464+ ("od_config.photodiode_channel" , "4" , "" ),
1465+ ],
1466+ ):
1467+ section = config ["od_config.photodiode_channel" ]
1468+ with start_od_reading (
1469+ section ,
1470+ interval = None ,
1471+ fake_data = True ,
1472+ experiment = experiment ,
1473+ calibration = False ,
1474+ ) as od :
1475+ assert set (od .channel_angle_map .keys ()) == {"2" }
1476+ assert set (od .adc_reader .channels ) == {"1" , "2" }
1477+
1478+
14561479def test_CachedCalibrationTransformer_with_real_calibration () -> None :
14571480 calibration = structs .OD600Calibration (
14581481 angle = "90" ,
You can’t perform that action at this time.
0 commit comments