Unit conversion factors#
Python module dendra.units.
These are scalar conversion factors, not unit-carrying quantities. See
Units used in Dendra before using compound-unit or point-process values; in
particular, built-in point-process conductances and weights use bare numerical
µS coordinates and must not be multiplied by uS.
Scalar unit conversions for Dendra’s public numerical conventions.
These names are ordinary float conversion factors, not unit-carrying
quantities. Multiply a value by one of them to express it in the base unit
documented by the receiving API. For example, model time is expressed in
milliseconds, voltage in millivolts, absolute injected current in milliamperes,
and morphology length in micrometers.
Do not construct compound units by algebraically combining these scalars. A
distributed mechanism conductance, for example, is already entered as a number
in S/cm²; it is not written as value * S / cm**2. Point-process method
bodies use a separate local convention (current in nA and conductance in µS),
described in dendra.models.mechanisms.PointProcess and in the units
guide.
- ms#
Millisecond time unit (base unit for time in Dendra).
- Type:
float
- s#
Second (
1000 * ms).- Type:
float
- minutes#
Minute (
60 * s).- Type:
float
- hours#
Hour (
60 * minutes).- Type:
float
- mV#
Millivolt voltage unit (base unit for voltage in Dendra).
- Type:
float
- V#
Volt (
1e3 * mV).- Type:
float
- mA#
Milliampere conversion for APIs that accept absolute current, including intracellular stimulation and public
i_membranevalues. Distributed mechanism currents instead use mA/cm²; point-process method bodies use a local bare-nA coordinate.- Type:
float
- A#
Ampere (
1e3 * mA).- Type:
float
- uA#
Microampere (
1e-6 * A).- Type:
float
- nA#
Nanoampere (
1e-9 * A).- Type:
float
- pA#
Picoampere (
1e-12 * A).- Type:
float
- fA#
Femtoampere (
1e-15 * A).- Type:
float
- ohm#
Ohm resistance unit.
- Type:
float
- S#
Siemens conductance unit (
1 / ohm).- Type:
float
- mS#
Millisiemens (
1e-3 * S).- Type:
float
- uS#
Microsiemens (
1e-6 * S).- Type:
float
- nS#
Nanosiemens (
1e-9 * S).- Type:
float
- pS#
Picosiemens (
1e-12 * S).- Type:
float
- fS#
Femtosiemens (
1e-15 * S).- Type:
float
- uF#
Microfarad capacitance unit (base unit for capacitance in Dendra).
- Type:
float
- F#
Farad (
1e6 * uF).- Type:
float
- nF#
Nanofarad (
1e-9 * F).- Type:
float
- pF#
Picofarad (
1e-12 * F).- Type:
float
- fF#
Femtofarad (
1e-15 * F).- Type:
float
- um#
Micrometer length unit (base unit for length in Dendra).
- Type:
float
- m#
Meter (
1e6 * um).- Type:
float
- cm#
Centimeter (
1e-2 * m).- Type:
float
- mm#
Millimeter (
1e-3 * m).- Type:
float
- nm#
Nanometer (
1e-9 * m).- Type:
float
- kHz#
Kilohertz frequency unit (base unit for frequency in Dendra).
- Type:
float
- Hz#
Hertz (
1e-3 * kHz).- Type:
float
- MHz#
Megahertz (
1e3 * kHz).- Type:
float
- GHz#
Gigahertz (
1e6 * kHz).- Type:
float
Examples
Use these conversions with APIs whose documented base units match them:
>>> from dendra import units as U
>>> length = 100 * U.um
>>> dt = 0.025 * U.ms
>>> holding_potential = -65 * U.mV
>>> injected_current = 2 * U.nA # converted to Dendra's absolute-current unit, mA