braincell.mech module

braincell.mech module#

Declarative mechanism specs for braincell.Cell.

The braincell.mech package is purely declarative: it describes what to install on a cell without touching runtime state, JAX, or brainstate. Every declaration type inherits from the Mechanism marker base class.

  • Density mechanisms — distributed over a region of a cell. See Density and its concrete subclasses Channel (for ion channels) and Ion (for ion species). Both accept a registry key string or a class object for their first positional argument.

  • Point mechanisms — attached to a single location. See Point and its concrete subclasses CurrentClamp, SineClamp, FunctionClamp, StateProbe, MechanismProbe, CurrentProbe, ProbeMechanism, and Synapse. Junction is the gap-junction point declaration and lives in braincell.mech._junction.

Passive cable properties are recorded via CableProperty.

Class lookup by name is handled by MechanismRegistry (accessed through get_registry()). Concrete channel / ion / synapse classes register themselves with the global registry via the register_channel() / register_ion() / register_synapse() decorators, which run as a side effect of

importing braincell.channel / braincell.ion / braincell.synapse.

See also

braincell.channel

Concrete ion-channel implementations.

braincell.ion

Concrete ion-species implementations.

braincell.synapse

Concrete synapse implementations.

braincell.mech is the purely declarative mechanism layer for braincell.Cell. It describes what to install on a cell without touching runtime state, JAX, or brainstate. Every declaration inherits from the Mechanism marker base class and splits into two families:

  • Density mechanisms are distributed over a region of a cell (Density and its concrete subclasses Channel for ion channels and Ion for ion species).

  • Point mechanisms are attached to a single location (Point and its subclasses, including Synapse, Junction, and the probe declarations).

The passive cable property and the stimulus clamps (CableProperty, CurrentClamp, SineClamp, FunctionClamp) are also declared here but are re-exported at the top level; see braincell module for their reference entries.

Base#

Mechanism

Marker base class for every mechanism declaration.

Params

Frozen, hashable, order-preserving mechanism parameter mapping.

Density Mechanisms#

Density

Base class for distributed mechanism declarations.

Channel

Distributed ion-channel declaration.

Ion

Distributed ion-species declaration.

Point Mechanisms#

Point

Marker base class for point-located mechanism declarations.

Junction

Gap-junction coupling declaration (placeholder).

Synapse

Registry-keyed synapse declaration.

Probes#

StateProbe

Probe for cell-owned state at one placed location.

MechanismProbe

Probe for runtime state on a named mechanism.

CurrentProbe

Probe for current at a placed location.

ProbeMechanism

Observer that records a named variable at a point location.