rmgpy.quantity.ScalarQuantity

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

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(self) → ScalarQuantity

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

getConversionFactorFromSI(self) → double

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

getConversionFactorToSI(self) → double

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

getUncertainty(self)

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

getUncertaintyType(self) → str

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

getValue(self)

The numeric value of the quantity, in the given units

isUncertaintyAdditive(self) → bool

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

isUncertaintyMultiplicative(self) → bool

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

setUncertainty(self, v)
setUncertaintyType(self, str v)

Check the uncertainty type is valid, then set it.

setValue(self, v)
uncertainty

ScalarQuantity.getUncertainty(self)

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

uncertaintyType

ScalarQuantity.getUncertaintyType(self) -> str

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

uncertainty_si

uncertainty_si: ‘double’

units

units: str

value

ScalarQuantity.getValue(self)

The numeric value of the quantity, in the given units

value_si

value_si: ‘double’