Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Make units fit for Python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktBurger committed Feb 13, 2024
1 parent 97415a3 commit 59d5d74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyleco_extras/utils/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
Created on Wed Feb 15 17:51:49 2023 by Benedikt Burger
"""

from typing import Union

import pint

ureg = pint.UnitRegistry()


def assume_units(value: pint.Quantity | str, units: pint.Unit | str) -> pint.Quantity:
def assume_units(value: Union[pint.Quantity, str], units: Union[pint.Unit, str]) -> pint.Quantity:
"""Return a unitful quantity, assuming, if necessary the `units`.
:param value: A value that may or may not be unitful.
Expand Down

0 comments on commit 59d5d74

Please sign in to comment.