Skip to content

Commit

Permalink
Move experimental module to io.spatial (#3384) (#3412)
Browse files Browse the repository at this point in the history
Co-authored-by: Julia Dark <[email protected]>
  • Loading branch information
github-actions[bot] and jp-dark authored Dec 9, 2024
1 parent 44b317b commit f48de86
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions apis/python/notebooks/tutorial_spatial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"\n",
"import tiledbsoma\n",
"from tiledbsoma import Experiment\n",
"from tiledbsoma.experimental import from_visium\n",
"from tiledbsoma.io.spatial import from_visium\n",
"\n",
"err = partial(print, file=stderr)\n"
]
Expand Down Expand Up @@ -183,7 +183,7 @@
"output_type": "stream",
"text": [
"Ingesting data/CytAssist_FFPE_Protein_Expression_Human_Glioblastoma/10x to data/CytAssist_FFPE_Protein_Expression_Human_Glioblastoma/soma\n",
"/tmp/ipykernel_35332/2080821725.py:3: UserWarning: Support for spatial types is experimental. Changes to both the API and data storage may not be backwards compatible.\n",
"/tmp/ipykernel_151554/2080821725.py:3: UserWarning: Support for spatial types is experimental. Changes to both the API and data storage may not be backwards compatible.\n",
" from_visium(\n"
]
}
Expand Down Expand Up @@ -548,7 +548,7 @@
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0xff65c6cb9b50>"
"<matplotlib.image.AxesImage at 0xff91a6664110>"
]
},
"execution_count": 19,
Expand Down Expand Up @@ -1181,7 +1181,7 @@
{
"data": {
"text/plain": [
"SpatialRead(data=<tiledbsoma._read_iters.TableReadIter object at 0xff65e817c8d0>, data_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), output_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), coordinate_transform=<IdentityTransform\n",
"SpatialRead(data=<tiledbsoma._read_iters.TableReadIter object at 0xff91a1754850>, data_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), output_coordinate_space=CoordinateSpace(axes=(Axis(name='x', unit='pixels'), Axis(name='y', unit='pixels'))), coordinate_transform=<IdentityTransform\n",
" input axes: ('x', 'y')\n",
" output axes: ('x', 'y')>)"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import h5py

from .._exception import SOMAError
from ..._exception import SOMAError


def _str_to_int(value: str) -> int:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
warnings.warn("Experimental spatial exporter requires the xarray package.")
raise err

from .. import DenseNDArray
from ..options._soma_tiledb_context import SOMATileDBContext
from ... import DenseNDArray
from ...options._soma_tiledb_context import SOMATileDBContext
from ._util import _str_to_int


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

from somacore import Axis, CoordinateSpace, IdentityTransform, ScaleTransform

from .. import (
from ... import (
Collection,
DataFrame,
DenseNDArray,
Expand All @@ -51,36 +51,36 @@
_util,
logging,
)
from .._arrow_types import df_to_arrow
from .._constants import SPATIAL_DISCLAIMER
from .._exception import (
from ..._arrow_types import df_to_arrow
from ..._constants import SPATIAL_DISCLAIMER
from ..._exception import (
AlreadyExistsError,
NotCreateableError,
SOMAError,
)
from .._soma_object import AnySOMAObject
from .._types import IngestMode
from ..io import from_anndata
from ..io.ingest import (
from ..._soma_object import AnySOMAObject
from ..._types import IngestMode
from ...options._tiledb_create_write_options import (
TileDBCreateOptions,
TileDBWriteOptions,
)
from .. import from_anndata
from ..ingest import (
IngestCtx,
IngestionParams,
_create_or_open_collection,
_maybe_set,
_write_arrow_table,
add_metadata,
)
from ..options._tiledb_create_write_options import (
TileDBCreateOptions,
TileDBWriteOptions,
)
from ._util import _read_visium_software_version

if TYPE_CHECKING:
from somacore.options import PlatformConfig

from ..io._common import AdditionalMetadata
from ..io._registration import ExperimentAmbientLabelMapping
from ..options import SOMATileDBContext
from ...options import SOMATileDBContext
from .._common import AdditionalMetadata
from .._registration import ExperimentAmbientLabelMapping


def path_validator(instance, attribute, value: Path) -> None: # type: ignore[no-untyped-def]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
warnings.warn("Experimental spatial outgestor requires the geopandas package.")
raise err

from .. import MultiscaleImage, PointCloudDataFrame
from .._constants import SOMA_JOINID
from ... import MultiscaleImage, PointCloudDataFrame
from ..._constants import SOMA_JOINID
from ._xarray_backend import dense_nd_array_to_data_array, images_to_datatree

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion apis/python/tests/test_basic_xarray_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import tiledbsoma as soma

soma_xarray = pytest.importorskip("tiledbsoma.experimental._xarray_backend")
soma_xarray = pytest.importorskip("tiledbsoma.io.spatial._xarray_backend")
xr = pytest.importorskip("xarray")


Expand Down
2 changes: 1 addition & 1 deletion apis/python/tests/test_export_multiscale_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import tiledbsoma as soma

soma_outgest = pytest.importorskip("tiledbsoma.experimental.outgest")
soma_outgest = pytest.importorskip("tiledbsoma.io.spatial.outgest")
sd = pytest.importorskip("spatialdata")


Expand Down
2 changes: 1 addition & 1 deletion apis/python/tests/test_export_point_cloud_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import tiledbsoma as soma

gpd = pytest.importorskip("geopandas")
soma_outgest = pytest.importorskip("tiledbsoma.experimental.outgest")
soma_outgest = pytest.importorskip("tiledbsoma.io.spatial.outgest")
spatialdata = pytest.importorskip("spatialdata")


Expand Down

0 comments on commit f48de86

Please sign in to comment.