Skip to content

Commit

Permalink
move units
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jun 28, 2023
1 parent f5ee006 commit 1a35d39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ome_types2/_mixins/_base_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

from pydantic import BaseModel, validator

from ome_types2.units import ureg

if TYPE_CHECKING:
import pint

Expand Down Expand Up @@ -129,7 +131,6 @@ def validate_id(cls, value: Any) -> Any:

def _quantity_property(field_name: str) -> property:
"""Create property that returns a ``pint.Quantity`` combining value and unit."""
from ome_types2._units import ureg

def quantity(self: Any) -> Optional["pint.Quantity"]:
value = getattr(self, field_name)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/v2/test_units_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from pint import DimensionalityError
from pydantic import ValidationError

from ome_types2._units import ureg
from ome_types2.model import simple_types
from ome_types2.model.ome_2016_06 import Channel, Laser, Plane
from ome_types2.units import ureg


def test_quantity_math():
Expand Down

0 comments on commit 1a35d39

Please sign in to comment.