𝗯𝗹𝗮𝗰𝘀 supervises the execution of experiments controlled by the 𝘭𝘢𝘣𝘴𝘤𝘳𝘪𝘱𝘵 𝘴𝘶𝘪𝘵𝘦. It manages experiment queuing and hardware-timed execution, and provides manual control over devices between shots.
AO.__init__() is supposed to log an error if it can't import the specified unit conversion class. This is designed to work by setting cls = None if the class can't be imported, which should then trigger the 'The unit conversion class {cls} could not be imported...' error message to be logged.
Previously this failed due to cls mistakenly being replaced with calib_class, so the if statement to generate that error message didn't get triggered. That would cause the cls.base_unit != default_units statement in the later elif clause to raise AttributeError: 'NoneType' object has no attribute 'base_unit'.
It's clear that this is a simple mixup since the if calib_class is None: statement occurs inside a if calib_class is not None: block so it could never get triggered. This PR corrects this little mixup.
AO.__init__()
is supposed to log an error if it can't import the specified unit conversion class. This is designed to work by settingcls = None
if the class can't be imported, which should then trigger the'The unit conversion class {cls} could not be imported...'
error message to be logged.Previously this failed due to
cls
mistakenly being replaced withcalib_class
, so theif
statement to generate that error message didn't get triggered. That would cause thecls.base_unit != default_units
statement in the laterelif
clause to raiseAttributeError: 'NoneType' object has no attribute 'base_unit'
.It's clear that this is a simple mixup since the
if calib_class is None:
statement occurs inside aif calib_class is not None:
block so it could never get triggered. This PR corrects this little mixup.