.. _prog_ref: 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 <../tutorials/index.html>`_ or the :ref:`NEURON scripting basics `. NEURON supports multiple programming languages. Most users work in Python, but HOC is also fully supported. See :ref:`python_accessing_hoc` and :ref:`hoc_python_accessing_hoc` for interoperability. ---- At a Glance ------------ The most commonly needed classes and topics, organized by task: .. grid:: 1 1 2 2 :gutter: 3 .. grid-item-card:: Build Cell Morphology :class-title: sd-fs-5 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 - :ref:`topology` --- connecting sections - :ref:`geometry` --- length, diameter, 3-D points .. grid-item-card:: Add Biophysics :class-title: sd-fs-5 Insert ion channels, set conductances, and define custom mechanisms. - :ref:`mech` - ``insert()``, range variables - `MechanismType `_ --- enumerate available mechanisms - `MechanismStandard `_ --- inspect mechanism parameters - `KSChan `_ --- kinetic scheme channels - :ref:`nmodl` --- the NMODL language .. grid-item-card:: Stimulate & Record :class-title: sd-fs-5 Inject current, clamp voltage, and capture simulation output. - `Vector `_ --- ``record()``, ``play()``, data storage - :ref:`standardruntools` --- ``finitialize``, ``continuerun`` - `CVode `_ --- variable time-step integration - `SaveState `_ / `BBSaveState `_ --- checkpointing - :class:`FInitializeHandler` --- custom init actions .. grid-item-card:: Build Networks :class-title: sd-fs-5 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 .. grid-item-card:: Reaction-Diffusion :class-title: sd-fs-5 Model intracellular and extracellular chemistry. - :ref:`neuron_rxd` --- overview of the rxd module - `RXD Tutorials <../rxd-tutorials/index.html>`_ --- hands-on examples - `Impedance `_ --- frequency-domain analysis .. grid-item-card:: Visualization & GUI :class-title: sd-fs-5 Plot results, display morphology, and build interactive interfaces. - `Graph `_ --- time-series and X-Y plots - `Shape `_ / `PlotShape `_ --- cell morphology display - `RangeVarPlot `_ --- range variable visualization - :ref:`panel` --- custom GUI panels - :class:`Deck`, :class:`VBox` --- GUI layout containers ---- Frequently Used Classes ----------------------- .. list-table:: :header-rows: 1 :widths: 25 50 25 * - 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: :ref:`funfit`, :ref:`printf_doc`, :ref:`math`. See also the :ref:`genindex` for a complete alphabetical listing. ---- Basic Programming ----------------- General-purpose programming facilities: math, strings, I/O, GUI design, dynamic code loading, and Python--HOC interoperability. .. toctree:: :maxdepth: 1 programming/mathematics.rst programming/strings.rst programming/guidesign.rst programming/references.rst programming/timer.rst programming/system.rst programming/errors.rst programming/dynamiccode.rst programming/projectmanagement.rst programming/internals.rst programming/neuron_classes.rst programming/hoc-from-python.rst Model Specification ------------------- Define cell morphology, insert biophysical mechanisms, specify ions and channels, build networks, and model reaction-diffusion. .. toctree:: :maxdepth: 1 modelspec/guitools.rst modelspec/programmatic.rst Simulation Control ------------------ Initialize, run, and manage simulations. Configure integrators, set environment variables, and control the interpreter. .. toctree:: :maxdepth: 1 simctrl/programmatic.rst simctrl/stdrun.rst compilationoptions.rst envvariables.rst simctrl/interpretermanagement.rst Visualization ------------- Plot simulation results, display cell morphology, and create interactive graphical interfaces. .. toctree:: :maxdepth: 1 visualization/glyph.rst visualization/graph.rst visualization/grapher.rst visualization/plotshapeclass.rst visualization/plotshape.rst visualization/rvarplt.rst visualization/shape.rst visualization/notify.rst visualization/gui.rst visualization/shapebox.rst visualization/oldgrph.rst Analysis -------- Programmatic and GUI-based tools for analyzing simulation output, including impedance analysis and curve fitting. .. toctree:: :maxdepth: 1 analysis/programmatic.rst analysis/guitools.rst