diff --git a/openff/units/exceptions.py b/openff/units/exceptions.py index 5b2bfe4..9183e81 100644 --- a/openff/units/exceptions.py +++ b/openff/units/exceptions.py @@ -1,3 +1,10 @@ +__all__ = [ + "MissingOpenMMUnitError", + "NoneQuantityError", + "NoneUnitError", +] + + class MissingOpenMMUnitError(Exception): """Raised when a unit cannot be converted to an equivalent OpenMM unit""" diff --git a/openff/units/units.py b/openff/units/units.py index 332425f..30cabfa 100644 --- a/openff/units/units.py +++ b/openff/units/units.py @@ -4,7 +4,7 @@ import uuid import warnings -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, TypeVar import pint from openff.utilities import requires_package @@ -52,7 +52,10 @@ def __reduce__(self): return _unpickle_unit, (Unit, self._units) -class Quantity(_Quantity): +_MagnitudeType = TypeVar("_MagnitudeType") + + +class Quantity(_Quantity[_MagnitudeType]): """A value with associated units.""" _REGISTRY = DEFAULT_UNIT_REGISTRY