Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch compiler does not notice changes to unit conversions #28

Open
philipstarkey opened this issue Oct 3, 2014 · 0 comments
Open

Batch compiler does not notice changes to unit conversions #28

philipstarkey opened this issue Oct 3, 2014 · 0 comments
Labels
bug Something isn't working major

Comments

@philipstarkey
Copy link
Member

Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


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.

@philipstarkey philipstarkey added major bug Something isn't working labels Apr 5, 2020
philipstarkey pushed a commit to philipstarkey/runmanager that referenced this issue Jun 25, 2020
Update to use new zprocess functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

1 participant