mdpy.unit.Unit#
- class mdpy.unit.Unit(base_dimension: BaseDimension, relative_value)[source]#
- __init__(base_dimension: BaseDimension, relative_value) None [source]#
- Parameters:
base_dimension (BaseDimension) – the dimension of unit
relative_value (int or float) – the relative value of
self
to the basic unit ofbase_dimension
Methods
__init__
(base_dimension, relative_value)- param base_dimension:
the dimension of unit
is_dimension_less
()is_dimension_less judges wether
self
is dimensionlessset_relative_value_to_one
()set_relative_value_to_one sets
self.relative_value = 1
sqrt
()sqrt returns square root of Unit
Attributes
base_dimension
base_dimension gets the dimension of the unit
relative_value
relative_value gets the relative value to the basic unit
unit_name
unit_name gets the name of the unit