# rmgpy.quantity.ScalarQuantity¶

class rmgpy.quantity.ScalarQuantity(value=0.0, units='', uncertainty=0.0, uncertainty_type='+|-')

The ScalarQuantity class provides a representation of a scalar physical quantity, with optional units and uncertainty information. The attributes are:

Attribute

Description

value

The numeric value of the quantity in the given units

units

The units the value was specified in

uncertainty

The numeric uncertainty in the value in the given units (unitless if multiplicative)

uncertainty_type

The type of uncertainty: '+|-' for additive, '*|/' for multiplicative

value_si

The numeric value of the quantity in the corresponding SI units

uncertainty_si

The numeric value of the uncertainty in the corresponding SI units (unitless if multiplicative)

It is often more convenient to perform computations using SI units instead of the given units of the quantity. For this reason, the SI equivalent of the value attribute can be directly accessed using the value_si attribute. This value is cached on the ScalarQuantity object for speed.

as_dict(self) dict

A helper function for YAML dumping

copy(self)

Return a copy of the quantity.

equals(self, quantity)

Return True if the everything in a quantity object matches the parameters in this object. If there are lists of values or uncertainties, each item in the list must be matching and in the same order. Otherwise, return False (Originally intended to return warning if units capitalization was different, however, Quantity object only parses units matching in case, so this will not be a problem.)

get_conversion_factor_from_si(self) double

Return the conversion factor for converting a quantity to a given set of units from the SI equivalent units.

get_conversion_factor_from_si_to_cm_mol_s(self) double

Return the conversion factor for converting into SI units only with all lengths in cm, instead of m. This is useful for outputting chemkin file kinetics. Depending on the stoichiometry of the reaction the reaction rate coefficient could be /s, cm^3/mol/s, cm^6/mol^2/s, and for heterogeneous reactions even more possibilities. Only lengths are changed. Everything else is in SI, i.e. moles (not molecules) and seconds (not minutes).

get_conversion_factor_to_si(self) double

Return the conversion factor for converting a quantity in a given set ofunits to the SI equivalent units.

Return True if the uncertainty is specified in additive format and False otherwise.

is_uncertainty_multiplicative(self) bool

Return True if the uncertainty is specified in multiplicative format and False otherwise.

make_object(self, dict data, dict class_dict)

A helper function for constructing objects from a dictionary (used when loading YAML files)

Parameters:
• data (dict) – The dictionary representation of the object

• class_dict (dict) – A mapping of class names to the classes themselves

Returns:

None

uncertainty

The numeric value of the uncertainty, in the given units if additive, or no units if multiplicative.

uncertainty_si

‘double’

Type:

uncertainty_si

uncertainty_type

'+|-' for additive, '*|/' for multiplicative

Type:

The type of uncertainty

units

unicode

Type:

units

value

The numeric value of the quantity, in the given units

value_si

‘double’

Type:

value_si