11.1.12.2. Unit¶
This module implements units.
A shortcut is defined for each unit prefix, e.g. pico
, nano
, micro
,
milli
, kilo
, mega
, tera
.
-
class
PySpice.Unit.Unit.
FrequencyMixin
[source]¶ Bases:
object
This class implements a frequency mixin.
-
property
period
¶ Return the period \(T = \frac{1}{f}\).
-
property
pulsation
¶ Return the pulsation \(\omega = 2\pi f\).
-
property
-
class
PySpice.Unit.Unit.
PeriodMixin
[source]¶ Bases:
object
This class implements a period mixin.
-
property
frequency
¶ Return the period \(f = \frac{1}{T}\).
-
property
pulsation
¶ Return the pulsation \(\omega = \frac{2\pi}{T}\).
-
property
-
class
PySpice.Unit.Unit.
PrefixedUnit
(unit=None, power=None, value_ctor=None, values_ctor=None)[source]¶ Bases:
object
This class implements a prefixed unit.
-
class
PySpice.Unit.Unit.
SiBaseUnit
(si_unit=None)[source]¶ Bases:
PySpice.Unit.Unit.Unit
This class implements an SI base unit.
-
class
PySpice.Unit.Unit.
SiDerivedUnit
(string=None, powers=None)[source]¶ Bases:
object
This class implements a unit defined as powers of SI base units.
-
exception
PySpice.Unit.Unit.
UnitError
[source]¶ Bases:
ValueError
-
class
PySpice.Unit.Unit.
UnitPrefix
[source]¶ Bases:
object
This class implements a unit prefix like kilo
-
class
PySpice.Unit.Unit.
UnitPrefixMetaclass
[source]¶ Bases:
type
Metaclass to register unit prefixes
-
class
PySpice.Unit.Unit.
UnitValue
(prefixed_unit, value)[source]¶ Bases:
object
This class implements a value with a unit and a power (prefix).
The value is not converted to float if the value is an int.
-
class
PySpice.Unit.Unit.
UnitValues
[source]¶ Bases:
numpy.ndarray
This class implements a Numpy array with a unit and a power (prefix).
-
class
PySpice.Unit.Unit.
ZeroPower
[source]¶ Bases:
PySpice.Unit.Unit.UnitPrefix