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

Added a spatialdata-io mirror #778

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/spatialdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
]

from spatialdata import dataloader, datasets, models, transformations
from spatialdata._accessors import io
from spatialdata._core._deepcopy import deepcopy
from spatialdata._core.centroids import get_centroids
from spatialdata._core.concatenate import concatenate
Expand Down
16 changes: 16 additions & 0 deletions src/spatialdata/_accessors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import types

try:
import spatialdata_io as io
except ImportError:

io = types.ModuleType("spatialdata_io")

def _raise_install_spatialdata_io() -> None:
raise AttributeError(
"To use readers, `spatialdata_io` must be installed, e.g. via `pip install spatialdata-io`."
)

io.__getattr__ = lambda *_: _raise_install_spatialdata_io()

__all__ = ["io"]
Loading