NEURON Programmer’s Reference
This is the complete reference for NEURON’s Python and HOC programming interfaces. For hands-on introductions, see the Python tutorials or the NEURON scripting basics.
NEURON supports multiple programming languages. Most users work in Python, but HOC is also fully supported. See Accessing HOC from Python and HOC accessing Python for interoperability.
At a Glance
The most commonly needed classes and topics, organized by task:
Create and connect sections to define cell shape and topology.
Section — the fundamental building block
SectionList — group and iterate over sections
SectionRef — reference to a section
Topology — connecting sections
Geometry — length, diameter, 3-D points
Insert ion channels, set conductances, and define custom mechanisms.
insert(), range variablesMechanismType — enumerate available mechanisms
MechanismStandard — inspect mechanism parameters
KSChan — kinetic scheme channels
NMODL — the NMODL language
Inject current, clamp voltage, and capture simulation output.
Vector —
record(),play(), data storageStandard Run Tools —
finitialize,continuerunCVode — variable time-step integration
SaveState / BBSaveState — checkpointing
FInitializeHandler— custom init actions
Wire cells together with synapses, spike detectors, and gap junctions.
NetCon — spike-triggered connections
ParallelContext — parallel and distributed simulation
ParallelNetManager — high-level network manager
LinearMechanism — linear circuit elements
StateTransitionEvent — discrete event models
Model intracellular and extracellular chemistry.
Basic Reaction-Diffusion — overview of the rxd module
RXD Tutorials — hands-on examples
Impedance — frequency-domain analysis
Frequently Used Classes
Class |
Purpose |
Category |
|---|---|---|
Record, store, and manipulate arrays of doubles |
Data |
|
Connect a spike source to a synaptic target |
Network |
|
Parallel and distributed simulation |
Network |
|
Group sections for iteration |
Morphology |
|
Variable time-step integrator |
Simulation |
|
Random number generation |
Math |
|
Matrix operations |
Math |
|
Plot data |
Visualization |
|
Display cell morphology |
Visualization |
|
File I/O operations |
Programming |
|
Query available mechanisms |
Model |
Additional commonly used classes: Glyph, GUIMath, Impedance, KSChan, LinearMechanism, List, MechanismStandard, ParallelNetManager, PlotShape, Pointer, PtrVector, PWManager, RangeVarPlot, SectionBrowser, SectionRef, StringFunctions, SymChooser, TextEditor, Timer, ValueFieldEditor.
Commonly referenced topics: FunctionFitter, Printf (Formatted Output), Math.
See also the Index for a complete alphabetical listing.
Basic Programming
General-purpose programming facilities: math, strings, I/O, GUI design, dynamic code loading, and Python–HOC interoperability.
Model Specification
Define cell morphology, insert biophysical mechanisms, specify ions and channels, build networks, and model reaction-diffusion.
Simulation Control
Initialize, run, and manage simulations. Configure integrators, set environment variables, and control the interpreter.
Visualization
Plot simulation results, display cell morphology, and create interactive graphical interfaces.
Analysis
Programmatic and GUI-based tools for analyzing simulation output, including impedance analysis and curve fitting.