pcdsdevices.utils.convert_unit

pcdsdevices.utils.convert_unit(value: float, unit: str, new_unit: str)

One-line unit conversion.

Parameters:
  • value (float) – The starting value for the conversion.

  • unit (str) – The starting unit for the conversion.

  • new_unit (str) – The desired unit for the conversion.

Returns:

new_value (float) – The starting value, but converted to the new unit.