WrightTools.units module

Unit and label handling in WrightTools.

WrightTools.units.converter(val, current_unit, destination_unit)[source]

Convert from one unit to another.

Parameters:
  • val (number) – Number to convert.
  • current_unit (string) – Current unit.
  • destination_unit (string) – Destination unit.
Returns:

Converted value.

Return type:

number

WrightTools.units.get_symbol(units)[source]

Get default symbol type.

Parameters:units_str (string) – Units.
Returns:LaTeX formatted symbol.
Return type:string
WrightTools.units.get_valid_conversions(units)[source]
WrightTools.units.is_valid_conversion(a, b)[source]
WrightTools.units.kind(units)[source]

Find the kind of given units.

Parameters:units (string) – The units of interest
Returns:The kind of the given units. If no match is found, returns None.
Return type:string