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

run_lems_with_jneuroml_brian2 surprisingly requires the path to the LEMS file to be in the current directory #135

Open
jonrkarr opened this issue Nov 23, 2021 · 1 comment

Comments

@jonrkarr
Copy link

jonrkarr commented Nov 23, 2021

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.

@jonrkarr jonrkarr changed the title run_lems_with_jneuroml_brian2 surprisingly requires the path to the LEMS file to be added to the Python path run_lems_with_jneuroml_brian2 surprisingly requires the path to the LEMS file to be in the current directory Nov 23, 2021
@jonrkarr
Copy link
Author

I managed to get this to work, but it requires an unexpected amount of hacking beyond what's required to run simulations with jNeuroML:

  • Change to a specific directory
  • Set up the Python path in a particular way
  • Locate the LEMS file in a specific place
  • Set the exec_in_dir argument to a specific value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant