Skip to content

Commit

Permalink
Small fixes to new spatial classes (#231)
Browse files Browse the repository at this point in the history
* 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__`
  • Loading branch information
jp-dark authored Sep 30, 2024
1 parent 73ccc06 commit aff0f0f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion python-spec/src/somacore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"Scene",
"ImageProperties",
"MultiscaleImage",
"SpatialDataFrame",
"GeometryDataFrame",
"PointCloud",
"BatchSize",
Expand Down
2 changes: 1 addition & 1 deletion python-spec/src/somacore/ephemeral/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion python-spec/src/somacore/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions python-spec/src/somacore/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aff0f0f

Please sign in to comment.