### Navigation

- index
- modules |
- modules |
- next |
- previous |
- NEURON 7.3 documentation »

See also

- Basic Reaction-Diffusion
  - neuron.rxd.geometry3d

# neuron

For empirically-based simulations of neurons and networks of neurons in Python.

This is the top-level module of the official python interface to the NEURON simulation environment (http://www.neuron.yale.edu/neuron/).

Documentation is available in the docstrings.

For a list of available names, try dir(neuron).

Example:

$ ipython In [1]: import neuron NEURON – VERSION 6.2 2008-08-22 Duke, Yale, and the BlueBrain Project – Copyright 1984-2007 See http://www.neuron.yale.edu/credits.html

In [2]: neuron.h ?

## Important names and sub-packages

For help on these useful functions, see their docstrings:

> neuron.init, run, psection, load_mechanisms

neuron.h

> The top-level Hoc interpreter.

> Execute Hoc commands by calling h with a string argument:

>     >>> h('objref myobj')
>     >>> h('myobj = new Vector(10)')

> All Hoc defined variables are accessible by attribute access to h.

> Example:

>     >>> print h.myobj.x[9]

> Hoc Classes are also defined, for example:

>     >>> v = h.Vector([1,2,3])
>     >>> soma = h.Section()

> More help is available for the respective class by looking in the object docstring:

>     >>> help(h.Vector)

neuron.gui

> Import this package if you are using NEURON as an extension to Python, and you would like to use the NEURON GUI.

> If you are using NEURON with embedded python, “nrniv -python”, use rather “nrngui -python” if you would like to use the NEURON GUI.

$Id: __init__.py,v 1.1 2008/05/26 11:39:44 hines Exp hines $

class `neuron.``MetaHocObject`

  Provides Exception for Inheritance of multiple HocObject

  Methods

class `neuron.``Wrapper`

  Base class to provide attribute access for HocObjects.

`neuron.``hclass`(c)

  Class factory for subclassing h.anyclass. E.g. class MyList(hclass(h.List)):...

`neuron.``init`()

  function init():

  Initialize the simulation kernel. This should be called before a run(tstop) call.

  Equivalent to hoc finitialize():

  http://www.neuron.yale.edu/neuron/docs/help/neuron/neuron/nrnoc.html#finitialize

`neuron.``load_mechanisms`(path)

  Search for and load NMODL mechanisms from the path given.

  This function will not load a mechanism path twice.

  The path should specify the directory in which nrnmodliv was run, and in which the directory ‘i686’ (or ‘x86_64’ or ‘powerpc’ depending on your platform) was created

`neuron.``new_hoc_class`(name, doc=None)

  Returns a Python-wrapped hoc class where the object does not need to be associated with a section.

  doc - specify a docstring for the new hoc class

`neuron.``new_point_process`(name, doc=None)

  Returns a Python-wrapped hoc class where the object needs to be associated with a section.

  doc - specify a docstring for the new pointprocess class

`neuron.``nrn_dll`(printpath=False)

  Return a ctypes object corresponding to the NEURON library.

  Warning

  This provides access to the C-language internals of NEURON and should be used with care.

`neuron.``numpy_element_ref`(numpy_array, index)

  Return a HOC reference into a numpy array.

  Parameters : | numpy_array : `numpy.ndarray` the numpy array index : int the index into the numpy array .. warning:: : No bounds checking. .. warning:: : Assumes a contiguous array of doubles. In particular, be careful when using slices. If the array is multi-dimensional, the user must figure out the integer index to the desired element.

`neuron.``psection`(section)

  function psection(section):

  Print info about section in a hoc format which is executable. (length, parent, diameter, membrane information)

  See:

  http://www.neuron.yale.edu/neuron/docs/help/neuron/neuron/nrnoc.html#psection

`neuron.``run`(tstop)

  function run(tstop)

  Run the simulation (advance the solver) until tstop [ms]

`neuron.``test`()

  Runs a global battery of unit tests on the neuron module.

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- NEURON 7.3 documentation »