Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coordinate_space to Scene.create #249

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions python-spec/src/somacore/scene.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""Implementation of the SOMA scene collection for spatial data"""

import abc
from typing import Generic, Optional, Sequence, TypeVar, Union
from typing import Any, Generic, Optional, Sequence, TypeVar, Union

from typing_extensions import Final
from typing_extensions import Final, Self

from . import _mixin
from . import base
from . import collection
from . import coordinates
from . import options
from . import spatial

_MultiscaleImage = TypeVar("_MultiscaleImage", bound=spatial.MultiscaleImage)
Expand Down Expand Up @@ -90,6 +91,36 @@ class Scene(
Lifecycle: experimental
"""

@classmethod
@abc.abstractmethod
def create(
cls,
uri: str,
*,
coordinate_space: Optional[
Union[Sequence[str], coordinates.CoordinateSpace]
] = None,
platform_config: Optional[options.PlatformConfig] = None,
context: Optional[Any] = None,
) -> Self:
"""Creates a new scene at the given URI.

Args:
uri: The URI where the collection will be created.
coordinate_space: Optional coordinate space or the axis names for the
coordinate space the scene is defined on. If ``None`` no coordinate
system will be set at this time. Defaults to ``None``.
platform_config: platform-specific configuration; keys are SOMA
implementation names.
context: Other implementation-specific configuration.

Returns:
The newly created collection, opened for writing.

Lifecycle: experimental
"""
raise NotImplementedError()

@property
@abc.abstractmethod
def coordinate_space(self) -> Optional[coordinates.CoordinateSpace]:
Expand Down
Loading