Units in task scripts

Overview

This page outlines our guidelines for handling units in task scripts.

Guidelines

  • Always use the ts_lib_units UnitParser.parse() method to parse raw unit strings to the TetraScience standard units

  • If the unit is not recognized, a warning should be logged and the raw unit string should be stored in the unit field of the ts_ids_core.schema.RawValueRawUnit component instead.

  • If the IDS uses the ts_ids_core.schema.RawValueRawUnit or ts_ids_core.schema.ParameterRaw component, store the raw unit string in its raw_unit or raw_numerical_value_unit field, whether or not the unit is recognized.