Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Jul 14, 2023
1 parent 37ac49f commit 48dd89a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pioreactor/actions/self_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_REF_is_lower_than_0_dot_256_volts(

assert (
0.05 < readings[reference_channel] < 0.256
), f"Recorded {readings[reference_channel]} in REF, should ideally be between 0.05 and 0.256."
), f"Recorded {readings[reference_channel]} in REF, should ideally be between 0.05 and 0.256. Current IR LED: {ir_intensity}%."


def test_detect_heating_pcb(client: Client, logger: Logger, unit: str, experiment: str) -> None:
Expand Down
8 changes: 2 additions & 6 deletions pioreactor/background_jobs/od_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,6 @@ def __init__(self) -> None:
self.logger.debug("Not using any calibration.")


def noop(x):
return x


class CachedCalibrationTransformer(CalibrationTransformer):
def __init__(self, channel_angle_map: dict[pt.PdChannel, pt.PdAngle]) -> None:
super().__init__()
Expand All @@ -650,7 +646,7 @@ def __init__(self, channel_angle_map: dict[pt.PdChannel, pt.PdAngle]) -> None:
except Exception as e:
self.logger.debug(e, exc_info=True)
self.logger.error("Unable to load calibration models", exc_info=True)
self.models = {"1": noop, "2": noop}
raise e

def get_models_from_disk(
self, channel_angle_map: dict[pt.PdChannel, pt.PdAngle]
Expand Down Expand Up @@ -1173,7 +1169,7 @@ def start_od_reading(
else:
ir_led_reference_tracker = NullIrLedReferenceTracker() # type: ignore

# use OD600 calibration?
# use an OD calibration?
if use_calibration:
calibration_transformer = CachedCalibrationTransformer(channel_angle_map)
else:
Expand Down

0 comments on commit 48dd89a

Please sign in to comment.