spatialdata-io 0.6.0__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.gitignore +9 -4
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.pre-commit-config.yaml +3 -3
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/PKG-INFO +6 -5
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/README.md +1 -1
- spatialdata_io-0.7.1/_version.py +24 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/asv.conf.json +3 -3
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/benchmarks/benchmark_image.py +1 -1
- spatialdata_io-0.7.1/benchmarks/benchmark_imports.py +103 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/benchmarks/benchmark_xenium.py +1 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/conf.py +1 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/pyproject.toml +26 -23
- spatialdata_io-0.7.1/src/spatialdata_io/__init__.py +100 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/__main__.py +342 -47
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/_utils/_image.py +10 -61
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/_utils/_utils.py +19 -7
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/codex.py +4 -3
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/cosmx.py +7 -5
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/curio.py +3 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/dbit.py +2 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/generic.py +9 -12
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/iss.py +3 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/macsima.py +126 -27
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/mcmicro.py +3 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/merscope.py +3 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/seqfish.py +2 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/steinbock.py +26 -1
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/stereoseq.py +2 -2
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/visium.py +3 -2
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/visium_hd.py +24 -8
- spatialdata_io-0.7.1/src/spatialdata_io/readers/xenium.py +1130 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/readers/test_utils_image.py +0 -39
- spatialdata_io-0.7.1/tests/test_cli_alignment.py +116 -0
- spatialdata_io-0.7.1/tests/test_init.py +23 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/test_macsima.py +290 -31
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/test_xenium.py +80 -5
- spatialdata_io-0.6.0/_version.py +0 -34
- spatialdata_io-0.6.0/src/spatialdata_io/__init__.py +0 -61
- spatialdata_io-0.6.0/src/spatialdata_io/readers/_utils/_read_10x_h5.py +0 -144
- spatialdata_io-0.6.0/src/spatialdata_io/readers/xenium.py +0 -873
- spatialdata_io-0.6.0/tests/test_basic.py +0 -5
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.bumpversion.cfg +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.codecov.yaml +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.editorconfig +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.github/codecov.yml +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.github/release.yml +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.github/workflows/prepare_test_data.yaml +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.github/workflows/release.yaml +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.github/workflows/test.yaml +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.mypy.ini +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/.readthedocs.yaml +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/LICENSE +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/benchmarks/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/Makefile +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/_static/.gitkeep +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/_templates/.gitkeep +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/_templates/autosummary/class.rst +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/api.md +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/changelog.md +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/cli.md +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/contributing.md +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/extensions/.gitkeep +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/extensions/typed_returns.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/index.md +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/make.bat +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/references.bib +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/docs/references.md +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/_constants/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/_constants/_constants.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/_constants/_enum.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/_docs.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/_utils.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/converters/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/converters/generic_to_zarr.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/converters/legacy_anndata.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/experimental/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/src/spatialdata_io/readers/_utils/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/_utils.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/conftest.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/converters/__init__.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/converters/test_legacy_anndata.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/test_generic.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/test_seqfish.py +0 -0
- {spatialdata_io-0.6.0 → spatialdata_io-0.7.1}/tests/test_visium_hd.py +0 -0
|
@@ -35,12 +35,17 @@ __pycache__/
|
|
|
35
35
|
_version.py
|
|
36
36
|
node_modules/
|
|
37
37
|
.code-workspace
|
|
38
|
+
.asv/
|
|
39
|
+
uv.lock
|
|
40
|
+
|
|
41
|
+
# memray report
|
|
42
|
+
*.bin
|
|
43
|
+
|
|
44
|
+
# speedscope report
|
|
45
|
+
profile.speedscope.json
|
|
38
46
|
|
|
39
47
|
# test datasets (e.g. Xenium ones)
|
|
40
|
-
# symlinks
|
|
41
|
-
data
|
|
42
48
|
# data folder
|
|
43
49
|
data/
|
|
44
50
|
tests/data
|
|
45
|
-
|
|
46
|
-
.asv/
|
|
51
|
+
.venv
|
|
@@ -7,17 +7,17 @@ default_stages:
|
|
|
7
7
|
minimum_pre_commit_version: 2.16.0
|
|
8
8
|
repos:
|
|
9
9
|
- repo: https://github.com/rbubley/mirrors-prettier
|
|
10
|
-
rev: v3.
|
|
10
|
+
rev: v3.8.3
|
|
11
11
|
hooks:
|
|
12
12
|
- id: prettier
|
|
13
13
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
14
|
-
rev: v0.
|
|
14
|
+
rev: v0.15.12
|
|
15
15
|
hooks:
|
|
16
16
|
- id: ruff
|
|
17
17
|
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]
|
|
18
18
|
- id: ruff-format
|
|
19
19
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
20
|
-
rev: v1.
|
|
20
|
+
rev: v1.20.2
|
|
21
21
|
hooks:
|
|
22
22
|
- id: mypy
|
|
23
23
|
additional_dependencies: [numpy, types-PyYAML]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spatialdata-io
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: SpatialData IO for common techs
|
|
5
5
|
Project-URL: Documentation, https://spatialdata-io.readthedocs.io/
|
|
6
6
|
Project-URL: Source, https://github.com/scverse/spatialdata-io
|
|
@@ -50,7 +50,7 @@ Requires-Dist: pyarrow
|
|
|
50
50
|
Requires-Dist: readfcs
|
|
51
51
|
Requires-Dist: scanpy
|
|
52
52
|
Requires-Dist: scikit-image
|
|
53
|
-
Requires-Dist: spatialdata>=0.
|
|
53
|
+
Requires-Dist: spatialdata>=0.7.3a0
|
|
54
54
|
Requires-Dist: tifffile>=2023.8.12
|
|
55
55
|
Requires-Dist: xmltodict
|
|
56
56
|
Provides-Extra: dev
|
|
@@ -64,14 +64,15 @@ Requires-Dist: sphinx-book-theme>=1.0.0; extra == 'doc'
|
|
|
64
64
|
Requires-Dist: sphinx-click; extra == 'doc'
|
|
65
65
|
Requires-Dist: sphinx-copybutton; extra == 'doc'
|
|
66
66
|
Requires-Dist: sphinx-design; extra == 'doc'
|
|
67
|
-
Requires-Dist: sphinx
|
|
67
|
+
Requires-Dist: sphinx<9,>=4.5; extra == 'doc'
|
|
68
68
|
Requires-Dist: sphinxcontrib-bibtex>=1.0.0; extra == 'doc'
|
|
69
69
|
Provides-Extra: pre
|
|
70
|
-
Requires-Dist: spatialdata>=0.
|
|
70
|
+
Requires-Dist: spatialdata>=0.7.3a0; extra == 'pre'
|
|
71
71
|
Provides-Extra: test
|
|
72
72
|
Requires-Dist: pyarrow!=22; extra == 'test'
|
|
73
73
|
Requires-Dist: pytest; extra == 'test'
|
|
74
74
|
Requires-Dist: pytest-cov; extra == 'test'
|
|
75
|
+
Requires-Dist: pytest-mock; extra == 'test'
|
|
75
76
|
Description-Content-Type: text/markdown
|
|
76
77
|
|
|
77
78
|

|
|
@@ -110,7 +111,7 @@ This package contains reader functions to load common spatial omics formats into
|
|
|
110
111
|
|
|
111
112
|
Note: all mentioned technologies are registered trademarks of their respective companies.
|
|
112
113
|
|
|
113
|
-
Please refer to the list of [open Pull Requests](https://github.com/scverse/spatialdata-io/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aopen) for readers that are currently being developed.
|
|
114
|
+
Please refer to the list of [open Pull Requests](https://github.com/scverse/spatialdata-io/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aopen) for readers that are currently being developed. The list of [closed but unmerged PRs](https://github.com/scverse/spatialdata-io/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aunmerged+is%3Aclosed) may also contain useful code from old drafts of readers. Please get in touch if you would like to [contribute](https://github.com/scverse/spatialdata-io/blob/main/docs/contributing.md) and iterate on a PR, or reopen a closed one.
|
|
114
115
|
|
|
115
116
|
## Known limitations
|
|
116
117
|
|
|
@@ -34,7 +34,7 @@ This package contains reader functions to load common spatial omics formats into
|
|
|
34
34
|
|
|
35
35
|
Note: all mentioned technologies are registered trademarks of their respective companies.
|
|
36
36
|
|
|
37
|
-
Please refer to the list of [open Pull Requests](https://github.com/scverse/spatialdata-io/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aopen) for readers that are currently being developed.
|
|
37
|
+
Please refer to the list of [open Pull Requests](https://github.com/scverse/spatialdata-io/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aopen) for readers that are currently being developed. The list of [closed but unmerged PRs](https://github.com/scverse/spatialdata-io/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aunmerged+is%3Aclosed) may also contain useful code from old drafts of readers. Please get in touch if you would like to [contribute](https://github.com/scverse/spatialdata-io/blob/main/docs/contributing.md) and iterate on a PR, or reopen a closed one.
|
|
38
38
|
|
|
39
39
|
## Known limitations
|
|
40
40
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.7.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 7, 1)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"project": "spatialdata-io",
|
|
4
4
|
"project_url": "https://github.com/scverse/spatialdata-io",
|
|
5
5
|
"repo": ".",
|
|
6
|
-
"branches": ["
|
|
6
|
+
"branches": ["faster-imports", "main"],
|
|
7
7
|
"dvcs": "git",
|
|
8
8
|
"environment_type": "virtualenv",
|
|
9
|
-
"pythons": ["3.
|
|
9
|
+
"pythons": ["3.13"],
|
|
10
10
|
"build_command": [],
|
|
11
11
|
"install_command": ["python -m pip install {build_dir}[test]"],
|
|
12
12
|
"uninstall_command": ["python -m pip uninstall -y {project}"],
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"hash_length": 8,
|
|
18
18
|
"build_cache_size": 2,
|
|
19
19
|
"install_timeout": 600,
|
|
20
|
-
"repeat":
|
|
20
|
+
"repeat": 5,
|
|
21
21
|
"processes": 1,
|
|
22
22
|
"attribute_selection": ["time_*", "peakmem_*"]
|
|
23
23
|
}
|
|
@@ -16,7 +16,7 @@ from spatialdata import SpatialData
|
|
|
16
16
|
from spatialdata._logging import logger
|
|
17
17
|
from xarray import DataArray
|
|
18
18
|
|
|
19
|
-
from spatialdata_io import image
|
|
19
|
+
from spatialdata_io import image
|
|
20
20
|
|
|
21
21
|
# =============================================================================
|
|
22
22
|
# CONFIGURATION - Edit these values to match your setup
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""ASV benchmarks for spatialdata-io import times.
|
|
2
|
+
|
|
3
|
+
Measures how long it takes to import the package and individual readers
|
|
4
|
+
in a fresh subprocess, isolating import overhead from runtime work.
|
|
5
|
+
|
|
6
|
+
Running (with the current environment, no virtualenv rebuild):
|
|
7
|
+
# Quick sanity check (single iteration):
|
|
8
|
+
asv run --python=same --quick --show-stderr -v -b ImportBenchmark
|
|
9
|
+
|
|
10
|
+
# Full benchmark on current commit:
|
|
11
|
+
asv run --python=same --show-stderr -v -b ImportBenchmark
|
|
12
|
+
|
|
13
|
+
# Compare two branches (using --python=same, one-liner):
|
|
14
|
+
git stash && git checkout main && pip install -e . -q \
|
|
15
|
+
&& asv run --python=same -v -b ImportBenchmark \
|
|
16
|
+
&& git checkout faster-imports && git stash pop && pip install -e . -q \
|
|
17
|
+
&& asv run --python=same -v -b ImportBenchmark
|
|
18
|
+
# Then view the comparison:
|
|
19
|
+
asv compare $(git rev-parse main) $(git rev-parse faster-imports)
|
|
20
|
+
|
|
21
|
+
# Compare two branches (let ASV build virtualenvs, slower first run):
|
|
22
|
+
asv continuous --show-stderr -v -b ImportBenchmark main faster-imports
|
|
23
|
+
|
|
24
|
+
# Generate an HTML report:
|
|
25
|
+
asv publish && asv preview
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
import subprocess
|
|
29
|
+
import sys
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _import_time(statement: str) -> float:
|
|
33
|
+
"""Time an import in a fresh subprocess. Returns seconds."""
|
|
34
|
+
code = f"import time; t0=time.perf_counter(); {statement}; print(time.perf_counter()-t0)"
|
|
35
|
+
result = subprocess.run(
|
|
36
|
+
[sys.executable, "-c", code],
|
|
37
|
+
capture_output=True,
|
|
38
|
+
text=True,
|
|
39
|
+
)
|
|
40
|
+
if result.returncode != 0:
|
|
41
|
+
raise RuntimeError(result.stderr)
|
|
42
|
+
return float(result.stdout.strip())
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class ImportBenchmark:
|
|
46
|
+
"""Import-time benchmarks for spatialdata-io.
|
|
47
|
+
|
|
48
|
+
Each ``time_*`` method is a separate ASV benchmark.
|
|
49
|
+
They run in isolated subprocesses so that one import
|
|
50
|
+
does not warm the cache for the next.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
# ASV settings tuned for subprocess-based import timing:
|
|
54
|
+
timeout = 120 # seconds before ASV kills a benchmark; generous since each
|
|
55
|
+
# call spawns a subprocess (~2s each × 10 repeats = ~20s worst case)
|
|
56
|
+
repeat = 5 # number of timing samples ASV collects; high because import
|
|
57
|
+
# times have variance from OS caching / disk I/O / background load;
|
|
58
|
+
# ASV reports the median and IQR from these samples
|
|
59
|
+
number = 1 # calls per sample; must be 1 because each call spawns a fresh
|
|
60
|
+
# subprocess — running >1 would just re-import in a warm process
|
|
61
|
+
warmup_time = 0 # seconds of warm-up iterations before timing; disabled because
|
|
62
|
+
# each call is already a cold subprocess — warming up the parent
|
|
63
|
+
# process is meaningless
|
|
64
|
+
processes = 1 # number of ASV worker processes; 1 avoids parallel subprocesses
|
|
65
|
+
# competing for CPU / disk and inflating timings
|
|
66
|
+
|
|
67
|
+
# -- top-level package -------------------------------------------------
|
|
68
|
+
|
|
69
|
+
def time_import_spatialdata_io(self) -> float:
|
|
70
|
+
"""Wall time: ``import spatialdata_io`` (lazy, no readers loaded)."""
|
|
71
|
+
return _import_time("import spatialdata_io")
|
|
72
|
+
|
|
73
|
+
# -- single reader via the public API ----------------------------------
|
|
74
|
+
|
|
75
|
+
def time_from_spatialdata_io_import_xenium(self) -> float:
|
|
76
|
+
"""Wall time: ``from spatialdata_io import xenium``."""
|
|
77
|
+
return _import_time("from spatialdata_io import xenium")
|
|
78
|
+
|
|
79
|
+
def time_from_spatialdata_io_import_visium(self) -> float:
|
|
80
|
+
"""Wall time: ``from spatialdata_io import visium``."""
|
|
81
|
+
return _import_time("from spatialdata_io import visium")
|
|
82
|
+
|
|
83
|
+
def time_from_spatialdata_io_import_visium_hd(self) -> float:
|
|
84
|
+
"""Wall time: ``from spatialdata_io import visium_hd``."""
|
|
85
|
+
return _import_time("from spatialdata_io import visium_hd")
|
|
86
|
+
|
|
87
|
+
def time_from_spatialdata_io_import_merscope(self) -> float:
|
|
88
|
+
"""Wall time: ``from spatialdata_io import merscope``."""
|
|
89
|
+
return _import_time("from spatialdata_io import merscope")
|
|
90
|
+
|
|
91
|
+
def time_from_spatialdata_io_import_cosmx(self) -> float:
|
|
92
|
+
"""Wall time: ``from spatialdata_io import cosmx``."""
|
|
93
|
+
return _import_time("from spatialdata_io import cosmx")
|
|
94
|
+
|
|
95
|
+
# -- key dependencies (reference) --------------------------------------
|
|
96
|
+
|
|
97
|
+
def time_import_spatialdata(self) -> float:
|
|
98
|
+
"""Wall time: ``import spatialdata`` (reference)."""
|
|
99
|
+
return _import_time("import spatialdata")
|
|
100
|
+
|
|
101
|
+
def time_import_anndata(self) -> float:
|
|
102
|
+
"""Wall time: ``import anndata`` (reference)."""
|
|
103
|
+
return _import_time("import anndata")
|
|
@@ -39,7 +39,7 @@ from pathlib import Path
|
|
|
39
39
|
|
|
40
40
|
from spatialdata import SpatialData
|
|
41
41
|
|
|
42
|
-
from spatialdata_io import xenium
|
|
42
|
+
from spatialdata_io import xenium
|
|
43
43
|
|
|
44
44
|
# =============================================================================
|
|
45
45
|
# CONFIGURATION - Edit these paths to match your setup
|
|
@@ -127,6 +127,7 @@ nitpick_ignore = [
|
|
|
127
127
|
# If building the documentation fails because of a missing link that is outside your control,
|
|
128
128
|
# you can add an exception to this list.
|
|
129
129
|
("py:class", "Path"),
|
|
130
|
+
("py:class", "pathlib._local.Path"),
|
|
130
131
|
("py:class", "AnnData"),
|
|
131
132
|
("py:class", "SpatialData"),
|
|
132
133
|
("py:func", "imageio.imread"), # maybe this can be fixed
|
|
@@ -5,18 +5,18 @@ requires = ["hatchling", "hatch-vcs"]
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "spatialdata-io"
|
|
8
|
-
dynamic= [
|
|
9
|
-
|
|
8
|
+
dynamic = [
|
|
9
|
+
"version" # allow version to be set by git tags
|
|
10
10
|
]
|
|
11
11
|
description = "SpatialData IO for common techs"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.11"
|
|
14
|
-
license = {file = "LICENSE"}
|
|
14
|
+
license = { file = "LICENSE" }
|
|
15
15
|
authors = [
|
|
16
|
-
{name = "scverse"},
|
|
16
|
+
{ name = "scverse" },
|
|
17
17
|
]
|
|
18
18
|
maintainers = [
|
|
19
|
-
{name = "scverse", email = "scverse@scverse.scverse"},
|
|
19
|
+
{ name = "scverse", email = "scverse@scverse.scverse" },
|
|
20
20
|
]
|
|
21
21
|
urls.Documentation = "https://spatialdata-io.readthedocs.io/"
|
|
22
22
|
urls.Source = "https://github.com/scverse/spatialdata-io"
|
|
@@ -26,7 +26,7 @@ dependencies = [
|
|
|
26
26
|
"click",
|
|
27
27
|
"numpy",
|
|
28
28
|
"scanpy",
|
|
29
|
-
"spatialdata>=0.
|
|
29
|
+
"spatialdata>=0.7.3a0",
|
|
30
30
|
"scikit-image",
|
|
31
31
|
"h5py",
|
|
32
32
|
"joblib",
|
|
@@ -46,7 +46,7 @@ dev = [
|
|
|
46
46
|
"pre-commit"
|
|
47
47
|
]
|
|
48
48
|
doc = [
|
|
49
|
-
"sphinx>=4.5",
|
|
49
|
+
"sphinx>=4.5,<9",
|
|
50
50
|
"sphinx-book-theme>=1.0.0",
|
|
51
51
|
"myst-nb",
|
|
52
52
|
"sphinxcontrib-bibtex>=1.0.0",
|
|
@@ -61,13 +61,14 @@ test = [
|
|
|
61
61
|
"pytest",
|
|
62
62
|
"pytest-cov",
|
|
63
63
|
# https://github.com/scverse/spatialdata-io/issues/334
|
|
64
|
-
"pyarrow!=22"
|
|
64
|
+
"pyarrow!=22",
|
|
65
|
+
"pytest-mock"
|
|
65
66
|
]
|
|
66
67
|
# this will be used by readthedocs and will make pip also look for pre-releases, generally installing the latest available version
|
|
67
68
|
# update: readthedocs doens't seem to try to install pre-releases even if when trying to install the pre optional-dependency. For
|
|
68
69
|
# the moment, if needed, let's add the latest pre-release explicitly here.
|
|
69
70
|
pre = [
|
|
70
|
-
"spatialdata>=0.
|
|
71
|
+
"spatialdata>=0.7.3a0"
|
|
71
72
|
]
|
|
72
73
|
|
|
73
74
|
[tool.coverage.run]
|
|
@@ -80,7 +81,7 @@ omit = [
|
|
|
80
81
|
testpaths = ["tests"]
|
|
81
82
|
xfail_strict = true
|
|
82
83
|
addopts = [
|
|
83
|
-
"--import-mode=importlib",
|
|
84
|
+
"--import-mode=importlib", # allow using test files with same name
|
|
84
85
|
]
|
|
85
86
|
|
|
86
87
|
[tool.ruff]
|
|
@@ -95,19 +96,19 @@ exclude = [
|
|
|
95
96
|
"setup.py",
|
|
96
97
|
]
|
|
97
98
|
lint.select = [
|
|
98
|
-
"F",
|
|
99
|
-
"E",
|
|
100
|
-
"W",
|
|
101
|
-
"I",
|
|
102
|
-
"D",
|
|
103
|
-
"B",
|
|
104
|
-
"TID",
|
|
105
|
-
"C4",
|
|
106
|
-
"BLE",
|
|
107
|
-
"UP",
|
|
108
|
-
"RUF100",
|
|
109
|
-
"TCH",
|
|
110
|
-
"NPY",
|
|
99
|
+
"F", # Errors detected by Pyflakes
|
|
100
|
+
"E", # Error detected by Pycodestyle
|
|
101
|
+
"W", # Warning detected by Pycodestyle
|
|
102
|
+
"I", # isort
|
|
103
|
+
"D", # pydocstyle
|
|
104
|
+
"B", # flake8-bugbear
|
|
105
|
+
"TID", # flake8-tidy-imports
|
|
106
|
+
"C4", # flake8-comprehensions
|
|
107
|
+
"BLE", # flake8-blind-except
|
|
108
|
+
"UP", # pyupgrade
|
|
109
|
+
"RUF100", # Report unused noqa directives
|
|
110
|
+
"TCH", # Typing imports
|
|
111
|
+
"NPY", # Numpy specific rules
|
|
111
112
|
# "PTH", # Use pathlib
|
|
112
113
|
# "S" # Security
|
|
113
114
|
]
|
|
@@ -185,6 +186,8 @@ lint.ignore = [
|
|
|
185
186
|
# Unused imports
|
|
186
187
|
"F401",
|
|
187
188
|
]
|
|
189
|
+
[tool.ruff.lint.per-file-ignores]
|
|
190
|
+
"src/spatialdata_io/__init__.py" = ["I001"]
|
|
188
191
|
|
|
189
192
|
[tool.jupytext]
|
|
190
193
|
formats = "ipynb,md"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from importlib import import_module
|
|
2
|
+
from importlib.metadata import version
|
|
3
|
+
from typing import Any, TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
__version__ = version("spatialdata-io")
|
|
6
|
+
|
|
7
|
+
_LAZY_IMPORTS: dict[str, str] = {
|
|
8
|
+
# readers
|
|
9
|
+
"codex": "spatialdata_io.readers.codex",
|
|
10
|
+
"cosmx": "spatialdata_io.readers.cosmx",
|
|
11
|
+
"curio": "spatialdata_io.readers.curio",
|
|
12
|
+
"dbit": "spatialdata_io.readers.dbit",
|
|
13
|
+
"macsima": "spatialdata_io.readers.macsima",
|
|
14
|
+
"mcmicro": "spatialdata_io.readers.mcmicro",
|
|
15
|
+
"merscope": "spatialdata_io.readers.merscope",
|
|
16
|
+
"seqfish": "spatialdata_io.readers.seqfish",
|
|
17
|
+
"steinbock": "spatialdata_io.readers.steinbock",
|
|
18
|
+
"stereoseq": "spatialdata_io.readers.stereoseq",
|
|
19
|
+
"visium": "spatialdata_io.readers.visium",
|
|
20
|
+
"visium_hd": "spatialdata_io.readers.visium_hd",
|
|
21
|
+
"xenium": "spatialdata_io.readers.xenium",
|
|
22
|
+
"xenium_aligned_image": "spatialdata_io.readers.xenium",
|
|
23
|
+
"xenium_explorer_selection": "spatialdata_io.readers.xenium",
|
|
24
|
+
# readers file types
|
|
25
|
+
"generic": "spatialdata_io.readers.generic",
|
|
26
|
+
"geojson": "spatialdata_io.readers.generic",
|
|
27
|
+
"image": "spatialdata_io.readers.generic",
|
|
28
|
+
# converters
|
|
29
|
+
"generic_to_zarr": "spatialdata_io.converters.generic_to_zarr",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
__all__ = [
|
|
33
|
+
# readers
|
|
34
|
+
"codex",
|
|
35
|
+
"cosmx",
|
|
36
|
+
"curio",
|
|
37
|
+
"dbit",
|
|
38
|
+
"macsima",
|
|
39
|
+
"mcmicro",
|
|
40
|
+
"merscope",
|
|
41
|
+
"seqfish",
|
|
42
|
+
"steinbock",
|
|
43
|
+
"stereoseq",
|
|
44
|
+
"visium",
|
|
45
|
+
"visium_hd",
|
|
46
|
+
"xenium",
|
|
47
|
+
"xenium_aligned_image",
|
|
48
|
+
"xenium_explorer_selection",
|
|
49
|
+
# readers file types
|
|
50
|
+
"generic",
|
|
51
|
+
"geojson",
|
|
52
|
+
"image",
|
|
53
|
+
# converters
|
|
54
|
+
"generic_to_zarr",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def __getattr__(name: str) -> Any:
|
|
59
|
+
if name in _LAZY_IMPORTS:
|
|
60
|
+
module_path = _LAZY_IMPORTS[name]
|
|
61
|
+
mod = import_module(module_path)
|
|
62
|
+
val = getattr(mod, name)
|
|
63
|
+
globals()[name] = val
|
|
64
|
+
return val
|
|
65
|
+
else:
|
|
66
|
+
try:
|
|
67
|
+
return globals()[name]
|
|
68
|
+
except KeyError as e:
|
|
69
|
+
raise AttributeError(f"Module 'spatialdata_io' has no attribute '{name}'") from e
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def __dir__() -> list[str]:
|
|
73
|
+
return __all__ + ["__version__"]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if TYPE_CHECKING:
|
|
77
|
+
# readers
|
|
78
|
+
from spatialdata_io.readers.codex import codex
|
|
79
|
+
from spatialdata_io.readers.cosmx import cosmx
|
|
80
|
+
from spatialdata_io.readers.curio import curio
|
|
81
|
+
from spatialdata_io.readers.dbit import dbit
|
|
82
|
+
from spatialdata_io.readers.macsima import macsima
|
|
83
|
+
from spatialdata_io.readers.mcmicro import mcmicro
|
|
84
|
+
from spatialdata_io.readers.merscope import merscope
|
|
85
|
+
from spatialdata_io.readers.seqfish import seqfish
|
|
86
|
+
from spatialdata_io.readers.steinbock import steinbock
|
|
87
|
+
from spatialdata_io.readers.stereoseq import stereoseq
|
|
88
|
+
from spatialdata_io.readers.visium import visium
|
|
89
|
+
from spatialdata_io.readers.visium_hd import visium_hd
|
|
90
|
+
from spatialdata_io.readers.xenium import (
|
|
91
|
+
xenium,
|
|
92
|
+
xenium_aligned_image,
|
|
93
|
+
xenium_explorer_selection,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# readers file types
|
|
97
|
+
from spatialdata_io.readers.generic import generic, geojson, image
|
|
98
|
+
|
|
99
|
+
# converters
|
|
100
|
+
from spatialdata_io.converters.generic_to_zarr import generic_to_zarr
|