From aff0f0f19a8ad0265abce103cd393307e62c091a Mon Sep 17 00:00:00 2001 From: Julia Dark <24235303+jp-dark@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:48:00 -0400 Subject: [PATCH] Small fixes to new spatial classes (#231) * Fix params for `add_multiscale_image` * Update `coordinate_space` property to not be optional - This property is always set on initialization for the `PointCloud`, * Remove non-existant class `SpatialDataFrame` from `__all__` --- python-spec/src/somacore/__init__.py | 1 - python-spec/src/somacore/ephemeral/collections.py | 2 +- python-spec/src/somacore/scene.py | 2 +- python-spec/src/somacore/spatial.py | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/python-spec/src/somacore/__init__.py b/python-spec/src/somacore/__init__.py index f16b3f8..e34a3aa 100644 --- a/python-spec/src/somacore/__init__.py +++ b/python-spec/src/somacore/__init__.py @@ -71,7 +71,6 @@ "Scene", "ImageProperties", "MultiscaleImage", - "SpatialDataFrame", "GeometryDataFrame", "PointCloud", "BatchSize", diff --git a/python-spec/src/somacore/ephemeral/collections.py b/python-spec/src/somacore/ephemeral/collections.py index 583ed94..b3328b0 100644 --- a/python-spec/src/somacore/ephemeral/collections.py +++ b/python-spec/src/somacore/ephemeral/collections.py @@ -194,9 +194,9 @@ def add_multiscale_image( *, uri: str, type: pa.DataType, - image_type: str = "CYX", # TODO: Replace this arg after PR #219 is merged reference_level_shape: Sequence[int], axis_names: Sequence[str] = ("c", "x", "y"), + axis_types: Sequence[str] = ("channel", "height", "width"), ) -> spatial.MultiscaleImage: raise NotImplementedError() diff --git a/python-spec/src/somacore/scene.py b/python-spec/src/somacore/scene.py index 4c9f959..b07b314 100644 --- a/python-spec/src/somacore/scene.py +++ b/python-spec/src/somacore/scene.py @@ -154,9 +154,9 @@ def add_multiscale_image( *, uri: str, type: pa.DataType, - image_type: str = "CYX", # TODO: Replace this arg after PR #219 is merged reference_level_shape: Sequence[int], axis_names: Sequence[str] = ("c", "x", "y"), + axis_types: Sequence[str] = ("channel", "height", "width"), ) -> _MultiscaleImage: """Adds a ``MultiscaleImage`` to the scene and sets a coordinate transform between the scene and the dataframe. diff --git a/python-spec/src/somacore/spatial.py b/python-spec/src/somacore/spatial.py index 3d73984..f0c93f3 100644 --- a/python-spec/src/somacore/spatial.py +++ b/python-spec/src/somacore/spatial.py @@ -224,7 +224,7 @@ def index_column_names(self) -> Tuple[str, ...]: @property @abc.abstractmethod - def coordinate_space(self) -> Optional[coordinates.CoordinateSpace]: + def coordinate_space(self) -> coordinates.CoordinateSpace: """Coordinate space for this point cloud. Lifecycle: experimental @@ -470,7 +470,7 @@ def axis_names(self) -> Tuple[str, ...]: @property @abc.abstractmethod - def coordinate_space(self) -> Optional[coordinates.CoordinateSpace]: + def coordinate_space(self) -> coordinates.CoordinateSpace: """Coordinate space for this geometry dataframe. Lifecycle: experimental @@ -639,7 +639,7 @@ def axis_names(self) -> Tuple[str, ...]: @property @abc.abstractmethod - def coordinate_space(self) -> Optional[coordinates.CoordinateSpace]: + def coordinate_space(self) -> coordinates.CoordinateSpace: """Coordinate space for this multiscale image. Lifecycle: experimental