Skip to content

Conversation

JCGoran
Copy link
Collaborator

@JCGoran JCGoran commented Jul 24, 2025

Needs #3544.

Fixes #3414.

NMODL's previous way of handling identifiers was somewhat convoluted; this PR introduces 2 functions, mangle_protected_identifiers, and its inverse, demangle_protected_identifiers, which should accomplish the same thing, in much less lines of code. The name mangling is achieved via a regex (same way as before), but this time is generalized for:

  • all Python "hard" keywords (see the docs for details)
  • all sympy top-level identifiers, except those that conflict with certain NMODL/HOC builtin functions (such as sin, cos, etc.)

Also sprinkled in some type hints.
Also added test_ode.py to coverage collection.

This allows us to build NEURON with NRN_ENABLE_NMODL=ON.

TODO

  • add tests for integrate2c (was not using [de]mangle_identifiers before)

Copy link

✔️ 225cc45 -> Azure artifacts URL

Copy link

codecov bot commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 91.42857% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.66%. Comparing base (f2b0ff2) to head (b611c56).

Files with missing lines Patch % Lines
share/lib/python/neuron/nmodl/ode.py 91.42% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3543      +/-   ##
==========================================
+ Coverage   68.49%   68.66%   +0.17%     
==========================================
  Files         685      685              
  Lines      116720   116711       -9     
==========================================
+ Hits        79944    80141     +197     
+ Misses      36776    36570     -206     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

✔️ 225cc45 -> artifacts URL

@JCGoran JCGoran marked this pull request as ready for review July 24, 2025 22:03
Copy link
Contributor

✔️ d9e3d17 -> artifacts URL

Copy link

✔️ d9e3d17 -> Azure artifacts URL

@JCGoran JCGoran requested a review from nrnhines August 4, 2025 10:27
Copy link

✔️ 6059fe5 -> Azure artifacts URL

Copy link
Contributor

github-actions bot commented Aug 4, 2025

✔️ 6059fe5 -> artifacts URL

Copy link

✔️ 6a464cf -> Azure artifacts URL

Copy link
Contributor

github-actions bot commented Aug 5, 2025

✔️ 6a464cf -> artifacts URL

Copy link
Contributor

✔️ 2a6d889 -> artifacts URL

Copy link

✔️ 2a6d889 -> Azure artifacts URL

Copy link
Contributor

✔️ 8940991 -> artifacts URL

Copy link

✔️ 8940991 -> Azure artifacts URL

Copy link

✔️ 2b2f315 -> Azure artifacts URL

Copy link
Contributor

✔️ 2b2f315 -> artifacts URL

Copy link

✔️ b54d8d5 -> Azure artifacts URL

Copy link
Contributor

✔️ b54d8d5 -> artifacts URL

Copy link

Copy link
Contributor

✔️ b611c56 -> artifacts URL

Copy link

✔️ b611c56 -> Azure artifacts URL

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

Successfully merging this pull request may close these issues.

Consider refactoring SymPy solver code in NMODL
1 participant