Skip to content

units

Manage units and units conversions.

Used for model and data unit conversions.

UnitsInformation

UnitsInformation(udict, ureg, *args, **kwargs)

Bases: MutableMapping

Storage of units information.

Used for models or datasets.

Initialize UnitsInformation.

Behaves like a dict which allows to lookup units by id.

Q_ property

Q_

Get quantity for generating quantities.

from_sbml staticmethod

from_sbml(sbml, ureg=None)

Get pint UnitsInformation for model.

model_uid_dict staticmethod

model_uid_dict(model, ureg)

Populate the model uid dict for lookup.

from_sbml_doc staticmethod

from_sbml_doc(doc, ureg=None)

Get pint UnitsInformation for model in document.

normalize_changes staticmethod

normalize_changes(changes, uinfo)

Normalize all changes to units in given units dictionary.

This is a major helper function allowing to convert changes to the requested units.

Units

Units class.

Container for unit related functionality. Allows to read the unit information from SBML models and provides helpers for the unit conversion.

udef_to_str classmethod

udef_to_str(udef)

Format SBML unitDefinition as string.

Units have the general format (multiplier * 10^scale *ukind)^exponent (m * 10^s *k)^e

Returns the string "None" in case no UnitDefinition was provided.