|
1 | 1 | """Implementation of the SOMA scene collection for spatial data"""
|
2 | 2 |
|
3 | 3 | import abc
|
4 |
| -from typing import Generic, Optional, Sequence, TypeVar, Union |
| 4 | +from typing import Any, Generic, Optional, Sequence, TypeVar, Union |
5 | 5 |
|
6 |
| -from typing_extensions import Final |
| 6 | +from typing_extensions import Final, Self |
7 | 7 |
|
8 | 8 | from . import _mixin
|
9 | 9 | from . import base
|
10 | 10 | from . import collection
|
11 | 11 | from . import coordinates
|
| 12 | +from . import options |
12 | 13 | from . import spatial
|
13 | 14 |
|
14 | 15 | _MultiscaleImage = TypeVar("_MultiscaleImage", bound=spatial.MultiscaleImage)
|
@@ -90,6 +91,36 @@ class Scene(
|
90 | 91 | Lifecycle: experimental
|
91 | 92 | """
|
92 | 93 |
|
| 94 | + @classmethod |
| 95 | + @abc.abstractmethod |
| 96 | + def create( |
| 97 | + cls, |
| 98 | + uri: str, |
| 99 | + *, |
| 100 | + coordinate_space: Optional[ |
| 101 | + Union[Sequence[str], coordinates.CoordinateSpace] |
| 102 | + ] = None, |
| 103 | + platform_config: Optional[options.PlatformConfig] = None, |
| 104 | + context: Optional[Any] = None, |
| 105 | + ) -> Self: |
| 106 | + """Creates a new scene at the given URI. |
| 107 | +
|
| 108 | + Args: |
| 109 | + uri: The URI where the collection will be created. |
| 110 | + coordinate_space: Optional coordinate space or the axis names for the |
| 111 | + coordinate space the scene is defined on. If ``None`` no coordinate |
| 112 | + system will be set at this time. Defaults to ``None``. |
| 113 | + platform_config: platform-specific configuration; keys are SOMA |
| 114 | + implementation names. |
| 115 | + context: Other implementation-specific configuration. |
| 116 | +
|
| 117 | + Returns: |
| 118 | + The newly created collection, opened for writing. |
| 119 | +
|
| 120 | + Lifecycle: experimental |
| 121 | + """ |
| 122 | + raise NotImplementedError() |
| 123 | + |
93 | 124 | @property
|
94 | 125 | @abc.abstractmethod
|
95 | 126 | def coordinate_space(self) -> Optional[coordinates.CoordinateSpace]:
|
|
0 commit comments