Skip to content
Tom Willemsen edited this page Oct 1, 2018 · 5 revisions

Importing

Current mechanism

Currently the instrument scripts area has a custom import mechanism which essentially tries to replicate:

from * import *
import *

This has caused a number of issues with modules overwriting functions, everything being put in the global namespace, and module ordering conditions. It was decided at a meeting to phase out this method of importing instrument scripts.

Future (new) mechanism

Instrument script imports should use standard python imports everywhere, including in the instrument scripts __init__ file. This new mechanism will be phased in for new instruments and instruments that run into an issue with the old mechanism.When Python 3 comes along, we should go through the remaining instruments and also convert those to using standard python imports.

It was decided not to try to bulk-change all existing instrument scripts, as this is too risky in terms of potentially breaking scripts.

See also the issues linked to https://github.com/ISISComputingGroup/IBEX/issues/3496

Clone this wiki locally