Channel

Channel#

class braincell.mech.Channel(class_name, /, *, name=None, coverage_area_fraction=1.0, ion_name=None, ion_names=None, **params)[source]#

Distributed ion-channel declaration.

Parameters:
  • class_name (Any) – Registry key for the target channel class (e.g. "IL", "Na_HH1952", or "leaky" via an alias), or a class object such as braincell.channel.IL.

  • name (str | None) – Optional instance label. See Density.instance_name.

  • coverage_area_fraction (float) – Fraction in [0, 1] of the target CV’s lateral area this declaration covers. Callers rarely set this directly — it is typically computed by the paint lowering pass.

  • **params (Any) – Channel parameters, passed as keyword arguments with brainunit quantity values (e.g. g_max=0.1 * u.mS / u.cm ** 2, E=-70 * u.mV).

See also

Ion

Ion-species counterpart.

braincell.mech.register_channel

Registration decorator for channel classes.

Examples

>>> import brainunit as u
>>> import braincell
>>> from braincell.mech import Channel
>>> Channel("IL", g_max=0.1 * u.mS / u.cm ** 2, E=-70 * u.mV).category
'channel'

>>> # Passing a class object works too, as long as the class is
>>> # already registered (i.e. ``braincell.channel`` is imported).
>>> spec = Channel(braincell.channel.IL, g_max=0.1 * u.mS / u.cm ** 2)
>>> spec.class_name
'IL'
category: ClassVar[str] = 'channel'#

Category discriminator, set by concrete subclasses to "channel" or "ion". Instances of the abstract base have an empty string.