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

NeuronWrapper

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

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.

class neurodamus.core.EngineBase

A base class to define an engine.

Engines are the fundamental blocks to handle different kinds of cells, like Glia, in a plugin-like interface. Engines must either implement their own create_cells and create_synapses methods (for full flexibility) or specify which are the Manager classes.

Specifying the Manager classes is suitable for most cases. Without any customization an engine will default to use:

CellManagerCls = None # Use existing instance of CellDistributor InnerConnectivityCls = None # Use existing instance of SynapseRuleManager

Such setup is equivalent to not specifying the Engine for a given circuit, effectively handling additional circuits by the built-in Engine. Specifying CellManagerCls will instantiate cells with the new Engine. If a InnerConnectivityCls is not provided then only cell creation happens. Specifying InnerConnectivityCls alone is not supported.

CellManagerCls = None
CircuitPrecedence = 1

Precedence influences instantiation order. The lower the earlier setup

ConnectionTypes = {}

A dict of the new connection types and associated Manager class

InnerConnectivityCls = None
class neurodamus.core.MComplexLoadBalancer(force_regenerate=False)

Wrapper of the load balance Hoc Module with mcomplex.

exception neurodamus.core.OtherRankError
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.SimulationProgress
update_progress()

Callback function that refreshes the progress value (if enough time has elapsed) and then inserts the next call into the event queue.

neurodamus.core.mpi_no_errors(f)

Convenience decorator which checks all processes are fine when f returns

neurodamus.core.return_neuron_timings(f)

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

class 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

nested_depth = 0

Sub-Modules

configuration

Runtime configuration

random

Py Wrappers for the HOC RNGs

stimuli

Stimuli sources.

Module API

neurodamus.core.Neuron

alias of _Neuron

neurodamus.core.MPI

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

neurodamus.core.NeuronWrapper

alias of _Neuron

class neurodamus.core._utils.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.

property h

The neuron hoc interpreter, initializing if needed.

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.

section_in_stack(sec)

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

Decorators

neurodamus.core._utils.return_neuron_timings(f)

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

neurodamus.core._utils.mpi_no_errors(f)

Convenience decorator which checks all processes are fine when f returns

neurodamus.core._utils.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