core package¶
Essential Brian modules, in particular base classes for all kinds of brian objects.
Built-in preferences¶
Core Brian preferences
core.default_float_dtype = float64
Default dtype for all arrays of scalars (state variables, weights, etc.).
core.default_integer_dtype = int32
Default dtype for all arrays of integer scalars.
core.outdated_dependency_error = None
DEPRECATED: This preference is no longer used. Brian2 now relies on package managers (pip, conda) for dependency management instead of runtime version checking. Setting this preference has no effect and it will be removed in a future version.
Previously controlled whether to raise an error for outdated dependencies (
True) or just a warning (False).
core.stop_on_keyboard_interrupt = True
Whether to “gracefully” stop a simulation after pressing Ctrl+C (defaults to
True). Note that pressing Ctrl+C a second time will force the usual interruption mechanism.
base module¶
All Brian objects should derive from BrianObject.
Exported members:
BrianObject, BrianObjectException
Classes
|
All Brian objects derive from this class, defines magic tracking and update. |
|
High level exception that adds extra Brian-specific information to exceptions |
Functions
|
Returns a |
|
Decorates a function/method to allow it to be overridden by the current |
Attempts to create a |
clocks module¶
Clocks for the simulator.
Exported members:
BaseClock, Clock, EventClock, defaultclock
Classes
|
Abstract base class for all clocks in the simulator. |
|
An object that holds the simulation time and the time step. |
Method proxy to access the defaultclock of the currently active device |
|
A clock that advances through a predefined sequence of times. |
Functions
|
Check that the target time can be represented equally well with the new dt. |
Objects
The standard clock, used for objects that do not specify any clock or dt |
core_preferences module¶
Definitions, documentation, default values and validation functions for core Brian preferences.
Functions
|
functions module¶
Exported members:
DEFAULT_FUNCTIONS, Function, declare_types(), implementation()
Classes
|
An abstract specification of a function that can be used as part of model equations, etc. |
|
A simple container object for function implementations. |
|
Helper object to store implementations and give access in a dictionary-like fashion, using |
|
Class for representing constants (e.g. pi) that are understood by sympy. |
|
Represents |
Functions
|
Decorator to declare argument and result types for a function |
|
A simple decorator to extend user-written Python functions to work with code generation in other languages. |
|
Converts a given time to an integer time step. |
magic module¶
Exported members:
MagicError, MagicNetwork, collect(), magic_network, restore(), run(), start_scope(), stop(), store()
Classes
Error that is raised when something goes wrong in |
|
|
Functions
|
Return the list of |
|
Get all the objects in the current namespace that derive from |
|
Restore the state of the network and all included objects. |
|
Runs a simulation with all "visible" Brian objects for the given duration. |
Starts a new scope for magic functions |
|
Stops all running simulations. |
|
Store the state of the network and all included objects. |
Objects
Automatically constructed |
names module¶
Exported members:
Nameable
Classes
|
Base class to find a unique name for an object |
Functions
|
Determine a unique name. |
namespace module¶
Implementation of the namespace system, used to resolve the identifiers in
model equations of NeuronGroup and Synapses
Exported members:
DEFAULT_CONSTANTS, DEFAULT_FUNCTIONS, DEFAULT_UNITS, get_local_namespace()
Functions
|
Get the surrounding namespace. |
network module¶
Module defining the Network object, the basis of all simulation runs.
Preferences¶
Network preferences
core.network.default_schedule = ['start', 'groups', 'thresholds', 'synapses', 'resets', 'end']
Default schedule used for networks that don’t specify a schedule.
Exported members:
Network, profiling_summary(), scheduling_summary()
Classes
|
The main simulation controller in Brian |
|
Class to nicely display the results of profiling. |
|
Object representing the schedule that is used to simulate the objects in a network. |
|
Helper object to report simulation progress in |
Functions
|
Returns a |
|
Returns the minimal time difference for a post-synaptic effect after a spike. |
|
Returns a |
operations module¶
Exported members:
NetworkOperation, network_operation()
Classes
|
Object with function that is called every time step. |
Functions
|
Decorator to make a function get called every time step of a simulation. |
preferences module¶
Brian global preferences are stored as attributes of a BrianGlobalPreferences
object prefs.
Exported members:
BrianPreference, PreferenceError, brian_prefs, prefs
Classes
Class of the |
|
A class allowing for accessing preferences in a subcategory. |
|
Used for defining a Brian preference. |
|
Default preference validator |
Exception relating to the Brian preferences system. |
Functions
|
Make sure that a preference name is valid. |
|
Split a preference name into a base and end name. |
Objects
Preference categories: |
spikesource module¶
Exported members:
SpikeSource
Classes
A source of spikes. |
tracking module¶
Exported members:
Trackable
Classes
Keep track of all instances of classes derived from |
|
A |
|
Classes derived from this will have their instances tracked. |
variables module¶
Classes used to specify the type of a function, variable or common sub-expression.
Exported members:
ArrayVariable, AuxiliaryVariable, Constant, DynamicArrayVariable, LinkedVariable, Subexpression, Variable, VariableView, Variables, linked_var()
Classes
|
An object providing information about a model variable stored in an array (for example, all state variables). |
|
Variable description for an auxiliary variable (most likely one that is added automatically to abstract code, e.g. |
|
A scalar constant (e.g. the number of neurons |
|
An object providing information about a model variable stored in a dynamic array (used in |
|
A simple helper class to make linking variables explicit. |
|
An object providing information about a named subexpression in a model. |
|
An object providing information about model variables (including implicit variables such as |
|
A view on a variable that allows to treat it as an numpy array while allowing special indexing (e.g. with strings) in the context of a |
|
A container class for storing |
Functions
|
Helper function to return the |
|
Returns canonical string representation of the dtype of a value or dtype |
|
Represents a link target for setting a linked variable. |
|