neurodamus.core package

neurodamus.core

The neurodamus.core package implements several helper modules for building circuits with Neuron. They can be seen as a High-Level Neuron API, and several examples are found under examples.

Classes

Neuron

A wrapper over the neuron simulator.

MPI

A singleton of MPI runtime information

NeurodamusCore

A wrapper class representing an instance of Neuron with the required neurodamus hoc and mod modules loaded

Cell(*args, **kw)

A Cell abstraction.

CurrentSource([base_amp, delay, rng])

ProgressBarRank0(end, *args, **kwargs)

Helper Progressbar that only shows on Rank 0.

Decorators

return_neuron_timings(f)

Decorator to collect, return timings and show the progress on a neuron run

mpi_no_errors(f)

Convenience decorator which checks all processes are fine when f returns

run_only_rank0(f)

Decorator that makes a given func to run only in rank 0.

Sub-Modules

cell

A module implementing a high-level interface to Neuron cells.

configuration

Runtime configuration

mechanisms

Module defining cell mechanisms

random

Py Wrappers for the HOC RNGs

stimuli

Stimuli sources.

synapses

High-Level wrapper to Neuron's cell synapse mechanisms

Module API

neurodamus.core.Neuron

alias of _Neuron

neurodamus.core.MPI

alias of <neurodamus.core._mpi._MPI object>

neurodamus.core.NeurodamusCore

alias of _Neuron

class neurodamus.core.Cell(*args, **kw)

A Cell abstraction. It allows users to instantiate Cells from morphologies or create them from scratch using the Cell.Builder

class Builder

Enables building a cell from soma/axon blocks

Mechanisms

alias of Mechanism

add_synapse(src_seg: Neuron.nrn.Segment, target_seg: Neuron.nrn.Segment, syn_props_obj: object, **conn_options: dict) object

Adds an incoming synapse from another cell, according to the options.

add_synaptic_receptor(target_seg, syn_props_obj, **custom)

Creates a raw neuron Synapse

property builder

Returns the Section builder object, to build additional axon/dendrites

connect_to(synapse_receptor, threshold=None, delay=None, weight=None)

Creates a synapse between the current cell soma extremity and a given synapse receptor Notes: This is a relatively low-level f, there is no automatic registration of the netcon

init_soma(diam, name='soma', **params)

Creates a soma and returns the section builder NOTE: you must call create at the end so that the new sections are added to the cell

load_morphology(morpho_path, export_commands=False)

Creates the cell compartments according to the given morphology

class neurodamus.core.CurrentSource(base_amp=0.0, *, delay=0, rng=None)
class Constant(amp, duration, delay=0)

Class implementing a minimal IClamp for a Constant current.

class neurodamus.core.ProgressBarRank0(end, *args, **kwargs)

Helper Progressbar that only shows on Rank 0. For MPI clusters size > 1 it always uses simplified bars. Otherwise auto-detects (isatty).

class neurodamus.core._neuron._Neuron

A wrapper over the neuron simulator.

classmethod load_dll(dll_path)

Loads a Neuron mod file (typically an .so file in linux).

classmethod load_hoc(mod_name)

Loads a hoc module, available in the path.

classmethod require(*hoc_mods)

Load a set of hoc mods by name.

classmethod run_sim(t_stop, *monitored_sections, **params)

A helper to run the simulation, recording the Voltage in the specified cell sections.

Parameters:
  • t_stop – Stop time

  • *monitored_sections – Cell sections to be probed.

  • **params – Custom simulation parameters

Returns: A simulation object

section_in_stack(sec)

A contect manager to push and pop a section to the Neuron stack.

Decorators

neurodamus.core.return_neuron_timings(f)

Decorator to collect, return timings and show the progress on a neuron run

neurodamus.core.mpi_no_errors(f)

Convenience decorator which checks all processes are fine when f returns

neurodamus.core.run_only_rank0(f)

Decorator that makes a given func to run only in rank 0.

It will broadcast results IFF the user specifies return type notation. It handles nested level to avoid broadcasting while we are already in rank0_only mode

Source

api/neurodamus.core.rst