From 6ab3d073f858fd8f62950244aa5951cf5bbda163 Mon Sep 17 00:00:00 2001 From: William Patton Date: Sun, 25 Aug 2024 14:04:32 -0400 Subject: [PATCH] remove pydantic serializable Coordinate Not needed --- funlib/persistence/arrays/metadata.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/funlib/persistence/arrays/metadata.py b/funlib/persistence/arrays/metadata.py index c71cf78..0d2d400 100644 --- a/funlib/persistence/arrays/metadata.py +++ b/funlib/persistence/arrays/metadata.py @@ -8,16 +8,6 @@ from funlib.geometry import Coordinate -class PydanticCoordinate(Coordinate): - @classmethod - def __get_validators__(cls): - yield cls.validate - - @classmethod - def validate(cls, v, val_info): - return Coordinate(*v) - - class MetaDataFormat(BaseModel): offset_attr: str = "offset" voxel_size_attr: str = "voxel_size" @@ -120,9 +110,9 @@ def parse( class MetaData: def __init__( self, - shape: PydanticCoordinate, - offset: Optional[PydanticCoordinate] = None, - voxel_size: Optional[PydanticCoordinate] = None, + shape: Coordinate, + offset: Optional[Coordinate] = None, + voxel_size: Optional[Coordinate] = None, axis_names: Optional[list[str]] = None, units: Optional[list[str]] = None, ): @@ -135,7 +125,7 @@ def __init__( self.validate() @property - def offset(self) -> PydanticCoordinate: + def offset(self) -> Coordinate: return ( self._offset if self._offset is not None @@ -143,7 +133,7 @@ def offset(self) -> PydanticCoordinate: ) @property - def voxel_size(self) -> PydanticCoordinate: + def voxel_size(self) -> Coordinate: return ( self._voxel_size if self._voxel_size is not None