Skip to content

Make BlueCellulab NEURON 9.0+ compatible#67

Merged
darshanmandge merged 1 commit intomainfrom
neuron9_#41
Mar 10, 2026
Merged

Make BlueCellulab NEURON 9.0+ compatible#67
darshanmandge merged 1 commit intomainfrom
neuron9_#41

Conversation

@darshanmandge
Copy link
Collaborator

Main Changes

Based on NEURON 9.0 release notes: https://github.com/neuronsimulator/nrn/releases/tag/9.0.0, the following main changes were made:

  • void** --> IvocVect** in DetAMPANMDA, DetGABAAB, ProbGABAAB_EMS, GluSynapse, and VecStim MOD files (both tests/mechanisms/ and examples/mechanisms/)
  • RNG-related void** patterns kept as-is (explicit casts, valid C++)
  • Replace deprecated neuron.run() with neuron.h.continuerun() in test_ballstick.py

Update test tolerances for NEURON 9.0 numerical differences

NEURON 9.0 release notes mention:

Usage of the Eigen library could introduce floating-point differences, but they are very small, validated and can be ignored. This required changes in relative tolerance for some of the tests.

  • Eigen library replacing Meschach introduces small FP differences (tightened to rel=5e-4 to abs=5e-3 for affected assertions)
  • RNG implementation changes produce different random sequences (relaxed tolerances for RNG-dependent test assertions)

Test reference files:

  • The use of the Eigen library instead of Meschach (as in previous versions) also leads to floating-point differences in the h5 files generated by some tests.
  • Hence, 10 SONATA H5 report output files in test needed an update based on simulation with NEURON 9.0.

- void** --> IvocVect** in DetAMPANMDA,
  DetGABAAB, ProbGABAAB_EMS, GluSynapse, and VecStim MOD files
  (both tests/mechanisms/ and examples/mechanisms/)
- RNG-related void** patterns kept as-is (explicit casts, valid C++)

- Replace deprecated neuron.run() with neuron.h.continuerun() in
  test_ballstick.py

Update test tolerances for NEURON 9.0 numerical differences
- Eigen library replacing Meschach introduces small FP differences
    (tightened to rel=5e-4 to abs=5e-3 for affected assertions)
- RNG implementation changes produce different random sequences
    (relaxed tolerances for RNG-dependent test assertions)

Test reference files:
- Update 10 h5 reference files with NEURON 9.0 Eigen-based outputs
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
tests/test_analysis/test_analysis.py 98.65% <100.00%> (ø)
tests/test_ballstick.py 86.41% <100.00%> (ø)
tests/test_cell/test_injector.py 98.72% <ø> (ø)
tests/test_cell/test_random.py 100.00% <100.00%> (ø)
tests/test_tools.py 98.86% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@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! Have you tried to run the examples with NEURON 9 ?

@darshanmandge
Copy link
Collaborator Author

I just ran the examples manually to see the figures generated in each notebook. They look fine at first glance.

The tests would have also run the examples.

Copy link

@WeinaJi WeinaJi left a comment

Choose a reason for hiding this comment

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

Are these mod files in example/mechanisms copied from neurodamus-models repo?
If yes, I am wondering if they can be copied on the fly during testing. That would be make them consistent

@darshanmandge
Copy link
Collaborator Author

Are these mod files in example/mechanisms copied from neurodamus-models repo?
I am wondering if they can be copied on the fly during testing. That would be make them consistent

Good idea. The README In the example/mechanisms folder does suggest that the mechanisms comes from neurodamus-models repository at specific commits. However, if I add the mod files from latest commit for the those folders neurodamus-models twe would probably need to update tests/examples. I can tackle this in a seperate issue if that is fine with you, @WeinaJi.

@WeinaJi
Copy link

WeinaJi commented Mar 10, 2026

I can tackle this in a seperate issue if that is fine with you

Yes, that plan sounds good. Probably you just do git clone neurodamus-models repo before executing this line in tox.
I also see that BlueCellLab has 2 places for mod files, examples/mechanisms and tests/mechanisms. It would be good to use one location with sub folders like neocortex, hippocampus, etc.

I don't have other comments for this PR. I will let @jamesgking comment.

Copy link

@jamesgking jamesgking left a comment

Choose a reason for hiding this comment

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

Changes look straight forward to me. Yes, I agree with idea to have a future PR use directly the models from other repo to avoid duplication and out of sync files

@darshanmandge
Copy link
Collaborator Author

darshanmandge commented Mar 10, 2026

Thank you, @WeinaJi and @jamesgking ! I created the new issue for mechanisms.

@darshanmandge darshanmandge merged commit 9275f87 into main Mar 10, 2026
8 checks passed
@darshanmandge darshanmandge deleted the neuron9_#41 branch March 19, 2026 21:20
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.

4 participants