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:

Build Cell Morphology

Create and connect sections to define cell shape and topology.

Add Biophysics

Insert ion channels, set conductances, and define custom mechanisms.

Stimulate & Record

Inject current, clamp voltage, and capture simulation output.

Build Networks

Wire cells together with synapses, spike detectors, and gap junctions.

Reaction-Diffusion

Model intracellular and extracellular chemistry.

Visualization & GUI

Plot results, display morphology, and build interactive interfaces.


Frequently Used Classes

Class

Purpose

Category

Vector

Record, store, and manipulate arrays of doubles

Data

NetCon

Connect a spike source to a synaptic target

Network

ParallelContext

Parallel and distributed simulation

Network

SectionList

Group sections for iteration

Morphology

CVode

Variable time-step integrator

Simulation

Random

Random number generation

Math

Matrix

Matrix operations

Math

Graph

Plot data

Visualization

Shape

Display cell morphology

Visualization

File

File I/O operations

Programming

MechanismType

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.