pycopancore.data_model.dimensional_quantity module

Module for DimensionalQuantity class.

class DimensionalQuantity(number, unit)[source]

Bases: object

Physical or other dimensional quantity given by a number of some unit

_dimension = None

The corresponding dimension

_number = None

The number of units this quantity equals

_unit = None

The unit in which this quantity is given

property dimension

Get the dimension of this quantity

number(unit=None)[source]

Get quantity as a dimensionless number of some (or the default) unit

reduce()[source]

return unit as dimensionless if it is nondimensional, else return self

tostr(width=12, decimals=2, unit=None)[source]
property unit

Get the unit this quantity is given in