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

Update mechanisms loading using NEURON API #83

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Conversation

anilbey
Copy link
Contributor

@anilbey anilbey commented Sep 26, 2023

Description

This PR uses the modern NEURON API in dealing with the mechanisms loading.
E.g. Bluecellulab previously was only checking for the x86_64, NEURON however supports a wider range of machine architectures such as: platform.machine(), "i686", "x86_64", "powerpc", "umac".

CHANGES

BREAKING CHANGES

  • rename expected env var BGLIBPY_MOD_LIBRARY_PATH -> BLUECELLULAB_MOD_LIBRARY_PATH
  • the env var expects the directory containing the mechs dir (same as in NEURON). Before, it was expecting the .so file (which is platform specific).

TODO

Squash and tag since there's behavioural change in import_mod_lib.

@anilbey anilbey changed the title Update mechanisms loading Update mechanisms loading using NEURON API >=8.* Sep 26, 2023
@anilbey anilbey changed the title Update mechanisms loading using NEURON API >=8.* Update mechanisms loading using NEURON>=8.* Sep 26, 2023
@anilbey anilbey changed the title Update mechanisms loading using NEURON>=8.* Update mechanisms loading using NEURON>=8.0 Sep 26, 2023
Copy link
Contributor

@AurelienJaquier AurelienJaquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Does this also work with NEURON 7? If not, is it ok to drop the support?

Copy link
Contributor

@ilkilic ilkilic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@anilbey
Copy link
Contributor Author

anilbey commented Sep 27, 2023

Very nice! Does this also work with NEURON 7? If not, is it ok to drop the support?

Yes the function was there 6 years ago.

neuronsimulator/nrn@8ae0ca8

@anilbey anilbey changed the title Update mechanisms loading using NEURON>=8.0 Update mechanisms loading using NEURON API Sep 27, 2023
add type_aliases.py, use NEURON types consistently

remove nrn_dpsable_banner, no longer required

use neuron.load_mechanisms in import_mod_lib

ModuleType to type functions taking neuron as arg

use BluecellulabError instead of bare Exception

add test_importer.py

use typing-extensions for older python versions
@anilbey
Copy link
Contributor Author

anilbey commented Sep 27, 2023

I just changed the commit text and PR text, removing the mention of NEURON>=8

@anilbey anilbey merged commit e6d414e into main Sep 27, 2023
@anilbey anilbey deleted the mechanisms-loading branch September 27, 2023 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants