๐ฟ๐๐ป๐บ๐ฎ๐ป๐ฎ๐ด๐ฒ๐ฟ is an intuitive graphical interface for controlling ๐ญ๐ข๐ฃ๐ด๐ค๐ณ๐ช๐ฑ๐ต ๐ด๐ถ๐ช๐ต๐ฆ experiments. Includes multi-dimensional parameter scans and a remote programming interface for automation.
Because labscript itself is whitelisted by the ModuleWatcher used in batch_compiler.py, labscript and anything it imports do not get watched for changes and unloaded if they change.
labscript imports labscript_utils.unitconversions, and so unitconversions is whitelisted and not reloaded. This is a problem! Unit conversions change, and new ones are introduced! We were making new ones today and were absolutely perplexed that our labscript code could not import them, until we realised what the problem was.
Perhaps batch_compiler.py can remove unitconversions from the its ModuleWatcher's whitelist.
But a better solution would probably be to have labscript not import unitconversions.
Users should probably import the unitconversions they need explicitly, at which point they will be handled as normal by the ModuleWatcher.
It's true that some devices have default unit conversions they rely on, but these devices are not in labscript core, but rather in labscript_devices.
If a device in labscript core requires a unit conversions class, it should be imported explicitly so that only its module ends up on the whitelist.
To ensure all unit conversion modules don't get run whenever a single one is imported, the gathering of unit conversion classes (for BLACS to look them up by name for example) should be done on a function call, rather than an import. That way anyone can import a specific unit conversions class without worrying that unitconversions/__init__.py will go and import everyone else's code, and we won't accidentally white listthings for theModuleWatcher that we didn't realise we were importing.
Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
Because
labscript
itself is whitelisted by theModuleWatcher
used inbatch_compiler.py
,labscript
and anything it imports do not get watched for changes and unloaded if they change.labscript
importslabscript_utils.unitconversions
, and sounitconversions
is whitelisted and not reloaded. This is a problem! Unit conversions change, and new ones are introduced! We were making new ones today and were absolutely perplexed that our labscript code could not import them, until we realised what the problem was.Perhaps
batch_compiler.py
can remove unitconversions from the its ModuleWatcher's whitelist.But a better solution would probably be to have
labscript
not importunitconversions
.Users should probably import the
unitconversions
they need explicitly, at which point they will be handled as normal by theModuleWatcher
.It's true that some devices have default unit conversions they rely on, but these devices are not in labscript core, but rather in
labscript_devices
.If a device in labscript core requires a unit conversions class, it should be imported explicitly so that only its module ends up on the whitelist.
To ensure all unit conversion modules don't get run whenever a single one is imported, the gathering of unit conversion classes (for BLACS to look them up by name for example) should be done on a function call, rather than an import. That way anyone can import a specific unit conversions class without worrying that
unitconversions/__init__.py
will go and import everyone else's code, and we won't accidentally white listthings for theModuleWatcher
that we didn't realise we were importing.