Closed chrisjbillington closed 3 years ago
Tested, seems to work:
Awesome! Maybe I'll be better about actually using custom unitconversion classes now.
Is there a recommended place where users should store their unitconversion classes? Presumably they have to live on the path somewhere, and would best be in the labscript-profile somewhere?
Anywhere in the import path will do, I would recommend putting them them in labscriptlib I think.
I'm a bit confused by that screenshot. Isn't it showing that all of the unit conversion classes used there are contained within labscript_utils.unitconversions
?
Oh, is it just showing that the full import path is saved? Then it shouldn't matter whether or not the import path starts with labscript_utils
?
Correct, any unit conversion class that is importable will work, and this PR is just to make labscript save the full import path of the class. The rest of the machinery in BLACS and labscript_utils
should work to make BLACS be able to find them, and this PR ought to be the final piece needed to let you use classes defined outside of labscript_utils
. These ones are in labscript_utils
just because I compiled example.py
to test.
Anywhere in the import path will do, I would recommend putting them them in labscriptlib I think.
Great. I can't say I've ever imported anything from the labscriptlib before. Would it be something like: labscriptlib.common.myconversions.my_special_unit_conversion
?
Yeah, something like that would do fine!
I can't say I've ever imported anything from the labscriptlib before
In principle labscriptlib is a place for putting modular bits of experiment scrips that are re-used, but in practice most scripts seem to tend toward an all-in-one philosophy.
This allows unit conversion classes located outside of
labscript_utils
to be used.Closes #71