Params#
- class braincell.mech.Params(data=None, /, **kwargs)[source]#
Frozen, hashable, order-preserving mechanism parameter mapping.
- Parameters:
Notes
Iteration order matches declaration order: entries in
datacome first (in their original order), followed by entries inkwargs(in the order they were passed).Equality is dict-like — two instances with the same key-value pairs compare equal regardless of iteration order.
Hashing is consistent with equality: instances that compare equal share the same hash, so
Paramsis safe to use as a dict key or set element.
Examples
>>> import brainunit as u >>> from braincell.mech import Params >>> p = Params(g_max=0.1 * u.mS / u.cm ** 2, E=-70 * u.mV) >>> p["g_max"] 0.1 * mS / cm ** 2 >>> list(p) ['g_max', 'E'] >>> p == Params(E=-70 * u.mV, g_max=0.1 * u.mS / u.cm ** 2) True