bellini.units

Module that contains the internal uniting system used for computations. The internal units can be changed as necessary, although computations should be the same regardless of what internal units system chosen.

bellini.units.ureg

The package-wide UnitRegistry used to specify units. Being from pint, be careful not to create pint.quantity.Quantity instead of bellini.quantity.Quantity, as these do not behave the same:

from bellini.units import ureg
from bellini.quantity import Quantity as Q
pint_quantity = 1 * ureg.mole # type(pint_quantity) = pint.quantity.Quantity
bellini_quantity = Q(1, ureg.mole) # type(bellini_quantity) = bellini.quantity.Quantity

Functions

get_internal_units(q)

Given united quantity q, returns the internal units corresponding to the units of q

to_internal_units(q)

Given united quantity q, returns q converted to its internal units