Skip to content

Make m, h and n standard recordable variables of HH_cond_exp, and respect their initial values - #856

Merged
apdavison merged 1 commit into
NeuralEnsemble:masterfrom
apdavison:fix-hh-cond-exp2-example
Nov 16, 2026
Merged

apdavison merged 1 commit into
NeuralEnsemble:masterfrom
apdavison:fix-hh-cond-exp2-example

Conversation

@apdavison

Copy link
Copy Markdown
Member

Currently, the gating variables m, h and n of HH_cond_exp cannot be recorded using their standard names. examples/HH_cond_exp2.py works around this with simulator-specific names. Also, on NEURON and Arbor, hh_traub.mod sets m = h = n = 0 at initialisation, ignoring the initial values given to PyNN (by default h = 1, as used by NEST and Brian 2). So the backends start from different states.

Here, we:

  • add m, h and n to the recordable variables of HH_cond_exp, and translate them on each backend (NEST already did);
  • pass the initial values of m, h and n to hh_traub.mod on NEURON and Arbor, through new minit, hinit and ninit parameters;
  • simplify HH_cond_exp2.py to record(['v', 'm', 'h', 'n'], ...).

A new test, test_HH_cond_exp_initial_gating_variables, checks the recorded initial values on all four backends, and that starting with h = 0 delays the first spike.

The four simulators now give closely matching results:

image

…espect their initial values on NEURON and Arbor

`hh_traub.mod` set m = h = n = 0 at initialisation, ignoring the values given to PyNN (by default h = 1, as used by NEST and Brian 2). `HH_cond_exp2.py` no longer needs simulator-specific variable names, or its `can_record` workaround, whose signature was out of date.
@apdavison apdavison added this to the 0.13.1 milestone Nov 15, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 73.798% (+0.05%) from 73.745% — apdavison:fix-hh-cond-exp2-example into NeuralEnsemble:master

@apdavison
apdavison merged commit 4821e75 into NeuralEnsemble:master Nov 16, 2026
9 checks passed
@apdavison
apdavison deleted the fix-hh-cond-exp2-example branch November 16, 2026 13:14
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.

2 participants