You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While reviewing PR #318 (DA pacemaking fix for #304), an AP-shape pathology was found in the SNc Dopaminergic preset that no existing test caught: the cell would spike normally (peak ~+27 mV, half-width ~1.7 ms — passing all bands), but then park at −30 mV for 20+ ms after the peak before finally dropping to AHP. Root cause was the Komendantov Na window current (m_inf = 0.79 at −30 mV) dominating the post-spike conductance landscape; SK / Ca dynamics were retuned in #318 to fix it.
Crucially, mean_half_width does not catch this. Half-width is measured at the spike midpoint (~−10 mV) — V can cross that level cleanly during the upstroke and downstroke and still hang at −30 mV afterwards. Likewise mean_ahp_depth finds the eventual AHP minimum even if it arrives 30 ms late.
The new regression test added in #318 — test_da_single_ap_repolarises_cleanly in tests/integration/test_dopaminergic.py — drives a single AP with the UI ACTION_POTENTIAL protocol (4 µA/cm² × 5 ms) and asserts that V drops below −60 mV within 5 ms after the peak. This pins the post-spike repolarization shape, which is what was actually broken.
Proposal
Add an analogous fall-time test to the preset test files for every preset in NEURON_PRESET_NAMES:
Drive a single evoked AP with that preset's ACTION_POTENTIAL protocol parameters.
Assert V drops below a species-appropriate threshold (typically −55 to −65 mV) within a species-appropriate window after the peak.
The exact threshold/window pair must come from the species literature. Examples:
Fast-spiking interneuron: very fast — V should drop below −60 mV within 1–2 ms after peak.
Cortical pyramidal: standard — within ~3–5 ms.
Thalamic-relay (tonic mode only): tonic AP only; the burst LTS plateau is a separate phenotype and should not be exercised by this test.
Purkinje: fast — peak to AHP within 2–3 ms.
CA1 pyramidal: ~4–6 ms.
STN: ~3–5 ms.
TRN (tonic mode only): same caveat as TC — burst-mode rebound LTS is separate.
Squid giant axon: HH52 reference; ~5 ms.
For presets that have both tonic and burst modes (TC, TRN), this test should target tonic mode explicitly, since the burst/LTS plateau is a real biological phenomenon and must not be conflated with a pathological Na-window plateau.
F-I curves can look pathologically wrong because the post-spike plateau prevents proper inter-spike repolarization, but the existing tests only check spike count and rolling-mean voltage — they miss shape problems.
A future change to a Na/K kinetic or a leak conductance can silently break repolarization in any preset.
Acceptance criteria
A test_<species>_single_ap_repolarises_cleanly test in each preset's test file.
Each test cites the literature source for its threshold/window choice.
All tests pass on main.
Where literature does not support a clean fall-time bound (e.g. burst-prone presets), the test is either restricted to tonic mode or explicitly omitted with a comment explaining why.
Background
While reviewing PR #318 (DA pacemaking fix for #304), an AP-shape pathology was found in the SNc Dopaminergic preset that no existing test caught: the cell would spike normally (peak ~+27 mV, half-width ~1.7 ms — passing all bands), but then park at −30 mV for 20+ ms after the peak before finally dropping to AHP. Root cause was the Komendantov Na window current (m_inf = 0.79 at −30 mV) dominating the post-spike conductance landscape; SK / Ca dynamics were retuned in #318 to fix it.
Crucially,
mean_half_widthdoes not catch this. Half-width is measured at the spike midpoint (~−10 mV) — V can cross that level cleanly during the upstroke and downstroke and still hang at −30 mV afterwards. Likewisemean_ahp_depthfinds the eventual AHP minimum even if it arrives 30 ms late.The new regression test added in #318 —
test_da_single_ap_repolarises_cleanlyintests/integration/test_dopaminergic.py— drives a single AP with the UIACTION_POTENTIALprotocol (4 µA/cm² × 5 ms) and asserts that V drops below −60 mV within 5 ms after the peak. This pins the post-spike repolarization shape, which is what was actually broken.Proposal
Add an analogous fall-time test to the preset test files for every preset in
NEURON_PRESET_NAMES:tests/integration/test_squid_giant_axon.pytests/integration/test_cortical_pyramidal.pytests/integration/test_fast_spiking_interneuron.pytests/integration/test_purkinje.pytests/integration/test_thalamic_relay.pytests/integration/test_ca1_pyramidal.pytests/integration/test_stn.pytests/integration/test_trn.py(plus any species-specific files I've missed)
Each test should:
ACTION_POTENTIALprotocol parameters.The exact threshold/window pair must come from the species literature. Examples:
For presets that have both tonic and burst modes (TC, TRN), this test should target tonic mode explicitly, since the burst/LTS plateau is a real biological phenomenon and must not be conflated with a pathological Na-window plateau.
Why this matters
Without this test:
Acceptance criteria
test_<species>_single_ap_repolarises_cleanlytest in each preset's test file.main.References
tests/integration/test_dopaminergic.py::test_da_single_ap_repolarises_cleanly.