# rmgpy.quantity.ScalarQuantity¶

class rmgpy.quantity.ScalarQuantity

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)
uncertaintyType 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.

copy()

Return a copy of the quantity.

equals()

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.)

getConversionFactorFromSI()

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

getConversionFactorToSI()

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

getUncertainty()

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

getUncertaintyType()

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

getValue()

The numeric value of the quantity, in the given units

isUncertaintyAdditive()

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

isUncertaintyMultiplicative()

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

setUncertaintyType()

Check the uncertainty type is valid, then set it.

uncertainty

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

uncertaintyType

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

value

The numeric value of the quantity, in the given units