Since this thing is on the innerwebs I suppose it should have a
[python_utils.git] / conversion_utils.py
index 8eaecd5bd7b8227b6cf8baeee4723e6bfa0450ed..68292caccbc692570010ab5ed98c10cbcc05d9c7 100644 (file)
@@ -1,4 +1,9 @@
 #!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# © Copyright 2021-2022, Scott Gasch
+
+"""Utilities involving converting between different units."""
 
 from typing import Callable, SupportsFloat
 
@@ -106,9 +111,7 @@ def convert(magnitude: SupportsFloat, from_thing: str, to_thing: str) -> float:
     return _convert(magnitude, src, dst)
 
 
-def _convert(
-    magnitude: SupportsFloat, from_unit: Converter, to_unit: Converter
-) -> float:
+def _convert(magnitude: SupportsFloat, from_unit: Converter, to_unit: Converter) -> float:
     canonical = from_unit.to_canonical(magnitude)
     converted = to_unit.from_canonical(canonical)
     return float(converted)