This statement requires the LEMS file to be on the Python path and more specifically in the current directory. This is surprising because this is atypical, and not required to execute LEMS files with pyNeuroML itself. Managing this is also complicated by LEMS files referencing other files.
A more flexible option to dynamically import modules is to use the importlib module. This would also enable this method to work on LEMS files whose names wouldn't be names of valid python modules (e.g., names with dashes).
Ideally, this method would also not rely on the extension of the LEMS file being .xml, and allow other extensions.
This is the problematic statement: https://github.com/NeuroML/pyNeuroML/blob/development/pyneuroml/pynml.py#L1592
This statement requires the LEMS file to be on the Python path and more specifically in the current directory. This is surprising because this is atypical, and not required to execute LEMS files with pyNeuroML itself. Managing this is also complicated by LEMS files referencing other files.
A more flexible option to dynamically import modules is to use the
importlib
module. This would also enable this method to work on LEMS files whose names wouldn't be names of valid python modules (e.g., names with dashes).Ideally, this method would also not rely on the extension of the LEMS file being
.xml
, and allow other extensions.