HH#
- class braincell.channel.HH(size, name=None)[source]#
HH gate dynamics with per-gate auto-detected form.
For each gate
gexactly one of the following method pairs must exist:f_<g>_infandf_<g>_tauf_<g>_alphaandf_<g>_beta
HHis the gating-only half of the template layer: it declaresgates, resolves and validates them once at subclass-creation time, and implements state initialisation, the conductance product, and the Hodgkin-Huxley derivative from whichever form each gate declares. It does not implement a current –OhmicHHadds the ohmic driving force for the common case, while channels with a non-ohmic current (GHK flux, permeability-scaled calcium channels) subclassHHdirectly and implementcurrent()themselves.See also
Notes
__init_subclass__resolves and validatesgatesonce, when the subclass is created, rather than lazily atreset_statetime. A subclass that declares no gates –HHitself,OhmicHH, or any other abstract intermediate – is skipped by this validation, so such classes stay definable without a concrete gate set.- Variables:
gates (tuple of Gate or tuple) – Class-level declaration of the gates a subclass defines. Each entry is either a
Gateor the plain tuple of its fields. Set by the subclass; read by__init_subclass__._resolved_gates (tuple of Gate) –
gatesnormalised toGateinstances. Derived by__init_subclass__; a subclass never sets this directly, but_iter_gates()and every gate-driven method read it._gate_forms (dict of str to str) – Maps each gate name to
"inf_tau"or"alpha_beta", the form detected for it. Derived alongside_resolved_gatesand read by_gate_form()to route state init, reset, and the derivative.
- compute_derivative(V, *ions)[source]#
Compute the derivative of the channel’s state variables.
This method should be implemented by subclasses to calculate how the channel’s state changes over time.
- Parameters:
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Raises:
NotImplementedError – This method must be implemented by subclasses.
- gate_phi(gate)[source]#
Resolve one gate’s temperature factor.
Resolution order is intentionally simple:
explicit
phiq10+temp_refusingself.tempdefault
1.0
The
q10branch is memoised per gate throughcached_q10_factor(); 99 of the catalogue’s 148 gates take it, and recomputing it once per gate per trace costs ~0.3 ms each.