Import Error after Update

We have been on 24.4.11 for a long time (mainly because we had students working with the system).
However, with the new version, I am encountering some import errors due to changes in pioreactor.strucs

“ImportError: cannot import name ‘PumpCalibration’ from ‘pioreactor.structs’”

Code snippet:

from pioreactor.structs import PumpCalibration
.

SlowPump = PumpCalibration(
name=“SlowCalibration”,
pioreactor_unit="testing",
created_at=“2024-01-01”,
pump=“”,
hz=180.0,
dc=25.0,
duration
=1.0,
bias_=0,
voltage=-1,
)

I guess I have to use
“from pioreactor.structs import CalibrationBase“
but I’m not sure how to update the code.

The chemostat automation is almost the same as found here

Ah yes, we changed calibrations signifcantly in version 25.1.21. Try this code instead:

from pioreactor.structs import SimplePeristalticPumpCalibration

...

SlowPump = SimplePeristalticPumpCalibration(
    calibration_name="SlowCalibration",
    calibrated_on_pioreactor_unit="testing",
    created_at="2024-01-01",
    hz=180.0,
    dc=25.0,
    voltage=-1,
    curve_type="poly",
    curve_data_=[1.0, 0.0],
    recorded_data={"x": [], "y": []},
)

That might be the only change you need - but if you encounter more errors, feel feel to show the rest of the code, too.