brainvisa / axon

Brainvisa main GUI
Other
0 stars 1 forks source link

modules mixup between "regular" python modules and brainvisa processes #71

Closed denisri closed 1 year ago

denisri commented 1 year ago

In Brainvisa (axon) the toolboxes processes path is added to the python modules search paths. If a toolbox process has the same name as a regular python module or package, this can lead to confusions and problems. Like, for instance, morphologist: it is both a process (a pipeline actually), and a package. I am actually surprised problems did not show up before now, but while porting to Capsul v3, I get errors because some code try to import the morphologist package sub-modules, and it fails because the pipeline module is already loaded in sys.modules["morphologist"]. Would it be possible to prefix all processes imports in a virtual package ("axon_process.morphomogist" for instance) ?

denisri commented 1 year ago

Actually sys.path does not seem to be modified, but processes are loaded as modules in the global namespace, thus any process which has the same name as a regular module can cause problem. We can investigate if we can load processes as modules inside another namespace, as proposed above.

denisri commented 1 year ago

Seems to be fixed.