11.1.11.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.
-
period
¶ Return the period \(T = \frac{1}{f}\).
-
pulsation
¶ Return the pulsation \(\omega = 2\pi f\).
-
-
class
PySpice.Unit.Unit.
PeriodMixin
[source]¶ Bases:
object
This class implements a period mixin.
-
frequency
¶ Return the period \(f = \frac{1}{T}\).
-
pulsation
¶ Return the pulsation \(\omega = \frac{2\pi}{T}\).
-
-
class
PySpice.Unit.Unit.
PrefixedUnit
(unit=None, power=None, value_ctor=None, values_ctor=None)[source]¶ Bases:
object
This class implements a prefixed unit.
-
is_unit_less
¶
-
power
¶
-
scale
¶
-
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.
-
hash
¶
-
powers
¶
-
string
¶
-
-
class
PySpice.Unit.Unit.
Unit
(si_unit=None)[source]¶ Bases:
object
This class implements a unit.
-
is_unit_less
¶
-
quantity
¶
-
si_unit
¶
-
unit_name
¶
-
unit_suffix
¶
-
-
exception
PySpice.Unit.Unit.
UnitError
[source]¶ Bases:
ValueError
-
class
PySpice.Unit.Unit.
UnitPrefix
[source]¶ Bases:
object
This class implements a unit prefix like kilo
-
is_defined_in_spice
¶
-
is_unit
¶
-
power
¶
-
prefix
¶
-
scale
¶
-
spice_prefix
¶
-
-
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.
-
power
¶
-
prefixed_unit
¶
-
scale
¶
-
unit
¶
-
value
¶
-
-
class
PySpice.Unit.Unit.
UnitValues
[source]¶ Bases:
numpy.ndarray
This class implements a Numpy array with a unit and a power (prefix).
-
CONVERSION
¶ alias of
PySpice.Tools.EnumFactory.ConversionType
-
UFUNC_MAP
= {<ufunc 'add'>: UNIT_MATCH, <ufunc 'subtract'>: UNIT_MATCH, <ufunc 'multiply'>: NEW_UNIT, <ufunc 'true_divide'>: NEW_UNIT, <ufunc 'logaddexp'>: FLOAT, <ufunc 'logaddexp2'>: FLOAT, <ufunc 'floor_divide'>: NEW_UNIT, <ufunc 'negative'>: NO_CONVERSION, <ufunc 'positive'>: NO_CONVERSION, <ufunc 'power'>: NEW_UNIT, <ufunc 'remainder'>: UNIT_MATCH, <ufunc 'fmod'>: NOT_IMPLEMENTED, <ufunc 'divmod'>: UNIT_MATCH, <ufunc 'absolute'>: NO_CONVERSION, <ufunc 'fabs'>: NOT_IMPLEMENTED, <ufunc 'rint'>: NO_CONVERSION, <ufunc 'sign'>: NO_CONVERSION, <ufunc 'heaviside'>: NOT_IMPLEMENTED, <ufunc 'conjugate'>: NOT_IMPLEMENTED, <ufunc 'exp'>: FLOAT, <ufunc 'exp2'>: FLOAT, <ufunc 'log'>: FLOAT, <ufunc 'log2'>: FLOAT, <ufunc 'log10'>: FLOAT, <ufunc 'expm1'>: FLOAT, <ufunc 'log1p'>: FLOAT, <ufunc 'sqrt'>: NEW_UNIT, <ufunc 'square'>: NEW_UNIT, <ufunc 'cbrt'>: NEW_UNIT, <ufunc 'reciprocal'>: NEW_UNIT, <ufunc 'sin'>: FLOAT, <ufunc 'cos'>: FLOAT, <ufunc 'tan'>: FLOAT, <ufunc 'arcsin'>: FLOAT, <ufunc 'arccos'>: FLOAT, <ufunc 'arctan'>: FLOAT, <ufunc 'arctan2'>: FLOAT, <ufunc 'hypot'>: FLOAT, <ufunc 'sinh'>: FLOAT, <ufunc 'cosh'>: FLOAT, <ufunc 'tanh'>: FLOAT, <ufunc 'arcsinh'>: FLOAT, <ufunc 'arccosh'>: FLOAT, <ufunc 'arctanh'>: FLOAT, <ufunc 'deg2rad'>: FLOAT, <ufunc 'rad2deg'>: FLOAT, <ufunc 'bitwise_and'>: NOT_IMPLEMENTED, <ufunc 'bitwise_or'>: NOT_IMPLEMENTED, <ufunc 'bitwise_xor'>: NOT_IMPLEMENTED, <ufunc 'invert'>: NOT_IMPLEMENTED, <ufunc 'left_shift'>: NOT_IMPLEMENTED, <ufunc 'right_shift'>: NOT_IMPLEMENTED, <ufunc 'greater'>: UNIT_MATCH_NO_OUT_CAST, <ufunc 'greater_equal'>: UNIT_MATCH_NO_OUT_CAST, <ufunc 'less'>: UNIT_MATCH_NO_OUT_CAST, <ufunc 'less_equal'>: UNIT_MATCH_NO_OUT_CAST, <ufunc 'not_equal'>: UNIT_MATCH_NO_OUT_CAST, <ufunc 'equal'>: UNIT_MATCH_NO_OUT_CAST, <ufunc 'logical_and'>: UNIT_MATCH, <ufunc 'logical_or'>: UNIT_MATCH, <ufunc 'logical_xor'>: UNIT_MATCH, <ufunc 'logical_not'>: UNIT_MATCH, <ufunc 'maximum'>: UNIT_MATCH, <ufunc 'minimum'>: UNIT_MATCH, <ufunc 'fmax'>: UNIT_MATCH, <ufunc 'fmin'>: UNIT_MATCH, <ufunc 'isfinite'>: NOT_IMPLEMENTED, <ufunc 'isinf'>: NOT_IMPLEMENTED, <ufunc 'isnan'>: NOT_IMPLEMENTED, <ufunc 'signbit'>: NOT_IMPLEMENTED, <ufunc 'copysign'>: NOT_IMPLEMENTED, <ufunc 'nextafter'>: NOT_IMPLEMENTED, <ufunc 'spacing'>: NOT_IMPLEMENTED, <ufunc 'modf'>: NOT_IMPLEMENTED, <ufunc 'ldexp'>: NOT_IMPLEMENTED, <ufunc 'frexp'>: NOT_IMPLEMENTED, <ufunc 'floor'>: NOT_IMPLEMENTED, <ufunc 'ceil'>: NO_CONVERSION, <ufunc 'trunc'>: NO_CONVERSION}¶
-
power
¶
-
prefixed_unit
¶
-
scale
¶
-
unit
¶
-
-
class
PySpice.Unit.Unit.
ZeroPower
[source]¶ Bases:
PySpice.Unit.Unit.UnitPrefix