upstage_des.units package#

Submodules#

upstage_des.units.convert module#

Conversions for common distance and time units.

unit_convert(value: int | float, units_from: str, units_to: str) float#

Convert between units of distance and time.

Units must be one of:

distance: km, m, mi, nmi, ft

time:

  • s, second, or seconds

  • min, minute, or minutes

  • hr, hour, or hours

  • day or days

  • week or weeks

All units are lower-cased on input.

Parameters:
  • value (int | float) – Value of “from” unit

  • units_from (str) – Unit to convert from

  • units_to (str) – Unit to convert to

Raises:

ValueError – _description_

Returns:

_description_

Return type:

float

Module contents#

Imports for units.