Units in task scripts¶
Overview¶
This page outlines our guidelines for handling units in task scripts.
Guidelines¶
Always use the
ts_lib_unitsUnitParser.parse()method to parse raw unit strings to the TetraScience standard unitsIf the unit is not recognized, a warning should be logged and the raw unit string should be stored in the
unitfield of thets_ids_core.schema.RawValueRawUnitcomponent instead.If the IDS uses the
ts_ids_core.schema.RawValueRawUnitorts_ids_core.schema.ParameterRawcomponent, store the raw unit string in itsraw_unitorraw_numerical_value_unitfield, whether or not the unit is recognized.