Skip to content

Commit

Permalink
added uncertainties to typing
Browse files Browse the repository at this point in the history
  • Loading branch information
varchasgopalaswamy committed Aug 26, 2023
1 parent ed950ab commit e4c7492
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pint/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

HAS_NUMPY = False
if TYPE_CHECKING:
from .compat import HAS_NUMPY
from .compat import HAS_NUMPY, HAS_AUTOUNCERTAINTIES

if HAS_NUMPY:
from .compat import np
Expand All @@ -25,8 +25,12 @@
Scalar: TypeAlias = Union[float, int, Decimal, Fraction]
Array: TypeAlias = Never

if HAS_AUTOUNCERTAINTIES:
from auto_uncertainties import Uncertainty
else:
Uncertainty: TypeAlias = Never
# TODO: Change when Python 3.10 becomes minimal version.
Magnitude = Union[Scalar, Array]
Magnitude = Union[Scalar, Array, Uncertainty]

UnitLike = Union[str, dict[str, Scalar], "UnitsContainer", "Unit"]

Expand Down

0 comments on commit e4c7492

Please sign in to comment.