spatialdata 0.7.3a2__tar.gz → 0.9.0__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-0.9.0/.claude/skills/memray/SKILL.md +37 -0
- spatialdata-0.9.0/.claude/skills/profimp/SKILL.md +30 -0
- spatialdata-0.9.0/.claude/skills/pyspy/SKILL.md +45 -0
- spatialdata-0.7.3a2/.github/codecov.yml → spatialdata-0.9.0/.codecov.yaml +3 -3
- spatialdata-0.9.0/.cruft.json +44 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/.editorconfig +3 -0
- spatialdata-0.9.0/.github/ISSUE_TEMPLATE/bug_report.yml +116 -0
- spatialdata-0.9.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- spatialdata-0.9.0/.github/ISSUE_TEMPLATE/feature_request.yml +11 -0
- spatialdata-0.9.0/.github/dependabot.yml +21 -0
- spatialdata-0.9.0/.github/workflows/autofix.yaml +32 -0
- spatialdata-0.9.0/.github/workflows/build.yaml +32 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/.github/workflows/build_image.yml +12 -6
- spatialdata-0.9.0/.github/workflows/release.yaml +33 -0
- spatialdata-0.9.0/.github/workflows/test.yaml +103 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/.gitignore +16 -16
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/.gitmodules +1 -1
- spatialdata-0.9.0/.panache.toml +15 -0
- spatialdata-0.9.0/.pre-commit-config.yaml +64 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/.readthedocs.yaml +4 -5
- spatialdata-0.9.0/.vscode/extensions.json +19 -0
- spatialdata-0.9.0/.vscode/launch.json +33 -0
- spatialdata-0.9.0/.vscode/settings.json +21 -0
- spatialdata-0.9.0/AGENTS.md +67 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/PKG-INFO +40 -27
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/README.md +19 -12
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/_version.py +2 -2
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/asv.conf.json +2 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/benchmarks/README.md +31 -2
- spatialdata-0.9.0/benchmarks/benchmark_dataloader.py +75 -0
- spatialdata-0.9.0/benchmarks/spatialdata_benchmark.py +111 -0
- spatialdata-0.9.0/biome.jsonc +30 -0
- spatialdata-0.9.0/docs/_static/css/custom.css +31 -0
- spatialdata-0.9.0/docs/_static/img/spatialdata_horizontal.svg +109 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/data_formats.md +8 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/datasets.md +1 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/io.md +1 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/models_utils.md +1 -0
- spatialdata-0.9.0/docs/changelog.md +16 -0
- spatialdata-0.9.0/docs/citation.md +5 -0
- spatialdata-0.9.0/docs/conf.py +128 -0
- spatialdata-0.9.0/docs/contributing.md +378 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/design_doc.md +56 -50
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/glossary.md +4 -4
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/index.md +56 -18
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/installation.md +1 -1
- spatialdata-0.9.0/docs/interoperability.md +20 -0
- spatialdata-0.9.0/docs/quickstart.md +33 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/references.bib +11 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/references.md +1 -1
- spatialdata-0.9.0/docs/user_guide.md +168 -0
- spatialdata-0.9.0/pyproject.toml +381 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/__init__.py +1 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/_deepcopy.py +28 -12
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/_utils.py +3 -3
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/centroids.py +21 -10
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/concatenate.py +11 -12
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/data_extent.py +15 -41
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/_utils.py +13 -5
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/aggregate.py +56 -20
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/map.py +13 -5
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/rasterize.py +81 -46
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/rasterize_bins.py +50 -41
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/transform.py +53 -22
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/vectorize.py +25 -11
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/query/_utils.py +18 -16
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/query/relational_query.py +338 -180
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/query/spatial_query.py +259 -171
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/spatialdata.py +371 -171
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/validation.py +10 -2
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_io/_utils.py +103 -37
- spatialdata-0.9.0/src/spatialdata/_io/exceptions.py +26 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_io/format.py +3 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_io/io_points.py +26 -9
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_io/io_raster.py +195 -35
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_io/io_shapes.py +47 -16
- spatialdata-0.9.0/src/spatialdata/_io/io_table.py +137 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_io/io_zarr.py +48 -9
- spatialdata-0.9.0/src/spatialdata/_types.py +28 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_utils.py +29 -19
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/dataloader/__init__.py +3 -5
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/dataloader/datasets.py +65 -31
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/datasets.py +84 -10
- spatialdata-0.9.0/src/spatialdata/datasets.yaml +27 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/models/__init__.py +2 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/models/_accessor.py +2 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/models/_utils.py +23 -12
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/models/chunks_utils.py +2 -2
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/models/models.py +180 -99
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/testing.py +4 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/transformations/_utils.py +12 -4
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/transformations/ngff/_utils.py +3 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/transformations/ngff/ngff_coordinate_system.py +9 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/transformations/ngff/ngff_transformations.py +9 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/transformations/operations.py +14 -7
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/transformations/transformations.py +381 -128
- spatialdata-0.9.0/src/spatialdata/utils/points.py +15 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/conftest.py +17 -9
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/test_rasterize_bins.py +0 -18
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/test_spatialdata_operations.py +8 -5
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/test_transform.py +74 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/query/test_relational_query.py +207 -1
- spatialdata-0.9.0/tests/core/query/test_relational_query_match_sdata_to_table.py +235 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/query/test_spatial_query.py +293 -1
- spatialdata-0.9.0/tests/core/test_get_attrs.py +138 -0
- spatialdata-0.9.0/tests/data/multipolygon.json +29 -0
- spatialdata-0.9.0/tests/data/polygon.json +17 -0
- spatialdata-0.9.0/tests/datasets/test_datasets.py +93 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_multi_table.py +1 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_readwrite.py +118 -10
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_utils.py +24 -1
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/models/test_models.py +60 -8
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/transformations/test_transformations.py +254 -117
- spatialdata-0.9.0/tests/utils/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/utils/test_sanitize.py +16 -0
- spatialdata-0.7.3a2/.bumpversion.cfg +0 -8
- spatialdata-0.7.3a2/.github/ISSUE_TEMPLATE/bug_report.md +0 -54
- spatialdata-0.7.3a2/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
- spatialdata-0.7.3a2/.github/workflows/release.yaml +0 -31
- spatialdata-0.7.3a2/.github/workflows/test.yaml +0 -69
- spatialdata-0.7.3a2/.mypy.ini +0 -27
- spatialdata-0.7.3a2/.pre-commit-config.yaml +0 -27
- spatialdata-0.7.3a2/benchmarks/spatialdata_benchmark.py +0 -67
- spatialdata-0.7.3a2/docs/Makefile +0 -24
- spatialdata-0.7.3a2/docs/_static/css/custom.css +0 -12
- spatialdata-0.7.3a2/docs/changelog.md +0 -4
- spatialdata-0.7.3a2/docs/conf.py +0 -185
- spatialdata-0.7.3a2/docs/contributing.md +0 -267
- spatialdata-0.7.3a2/docs/extensions/typed_returns.py +0 -31
- spatialdata-0.7.3a2/docs/user_guide.md +0 -216
- spatialdata-0.7.3a2/pyproject.toml +0 -212
- spatialdata-0.7.3a2/src/spatialdata/_io/io_table.py +0 -71
- spatialdata-0.7.3a2/src/spatialdata/_types.py +0 -16
- spatialdata-0.7.3a2/tests/core/query/test_relational_query_match_sdata_to_table.py +0 -147
- spatialdata-0.7.3a2/tests/core/test_get_attrs.py +0 -72
- spatialdata-0.7.3a2/tests/data/multipolygon.json +0 -55
- spatialdata-0.7.3a2/tests/data/polygon.json +0 -27
- spatialdata-0.7.3a2/tests/datasets/test_datasets.py +0 -28
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/.github/release.yml +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/Dockerfile +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/LICENSE +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/benchmarks/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/benchmarks/benchmark_imports.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/benchmarks/utils.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/_static/.gitkeep +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/_static/img/spatialdata_horizontal.png +0 -0
- /spatialdata-0.7.3a2/CHANGELOG.md → /spatialdata-0.9.0/docs/_templates/.gitkeep +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/SpatialData.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/dataloader.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/models.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/operations.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/testing.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/transformations.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api/transformations_utils.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/docs/api.md +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/__main__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_bridges/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/_elements.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/operations/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_core/query/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_docs.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_io/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/_logging.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/config.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/io/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/models/pyramids_utils.py +0 -0
- /spatialdata-0.7.3a2/src/spatialdata/transformations/ngff/__init__.py → /spatialdata-0.9.0/src/spatialdata/py.typed +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/src/spatialdata/transformations/__init__.py +0 -0
- {spatialdata-0.7.3a2/tests → spatialdata-0.9.0/src/spatialdata/transformations/ngff}/__init__.py +0 -0
- {spatialdata-0.7.3a2/tests/core → spatialdata-0.9.0/tests}/__init__.py +0 -0
- {spatialdata-0.7.3a2/tests/core/operations → spatialdata-0.9.0/tests/core}/__init__.py +0 -0
- {spatialdata-0.7.3a2/tests/core/query → spatialdata-0.9.0/tests/core/operations}/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/conftest.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/test_aggregations.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/test_map.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/test_rasterize.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/operations/test_vectorize.py +0 -0
- {spatialdata-0.7.3a2/tests/datasets → spatialdata-0.9.0/tests/core/query}/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/test_centroids.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/test_data_extent.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/test_deepcopy.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/core/test_validation.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/data/points.json +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/dataloader/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/dataloader/conftest.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/dataloader/test_datasets.py +0 -0
- {spatialdata-0.7.3a2/tests/io → spatialdata-0.9.0/tests/datasets}/__init__.py +0 -0
- {spatialdata-0.7.3a2/tests/models → spatialdata-0.9.0/tests/io}/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_attrs_io.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_format.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_metadata.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_partial_read.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/io/test_pyramids_performance.py +0 -0
- {spatialdata-0.7.3a2/tests/transformations → spatialdata-0.9.0/tests/models}/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/models/test_accessor.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/models/test_chunks_utils.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/models/test_pyramids_utils.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/test_init.py +0 -0
- {spatialdata-0.7.3a2/tests/transformations/ngff → spatialdata-0.9.0/tests/transformations}/__init__.py +0 -0
- {spatialdata-0.7.3a2/tests/utils → spatialdata-0.9.0/tests/transformations/ngff}/__init__.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/transformations/ngff/conftest.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/transformations/ngff/test_ngff_coordinate_system.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/transformations/ngff/test_ngff_transformations.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/transformations/test_transformations_utils.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/utils/test_element_utils.py +0 -0
- {spatialdata-0.7.3a2 → spatialdata-0.9.0}/tests/utils/test_testing.py +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memray
|
|
3
|
+
description: Profile the memory usage of a Python script using memray and visualize a temporal flamegraph in the browser. Use when the user wants to investigate memory consumption, find leaks, or understand allocation patterns.
|
|
4
|
+
compatibility: Requires the pixi profiling environment (pixi run -e profiling). Supports Linux and macOS.
|
|
5
|
+
allowed-tools: Bash(pixi run -e profiling memray-run:*) Bash(pixi run -e profiling memray-flame:*) Bash(open:*) Bash(xdg-open:*) Bash(python -m webbrowser:*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Ask the user which script to profile (full or relative path).
|
|
11
|
+
|
|
12
|
+
2. Run the script under memray:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pixi run -e profiling memray-run script.py
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This produces a binary file named `memray-script.py.<pid>.bin` in the current directory.
|
|
19
|
+
|
|
20
|
+
3. Generate the flamegraph HTML report from the `.bin` file:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pixi run -e profiling memray-flame memray-script.py.<pid>.bin
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Replace `<pid>` with the actual PID shown in the filename. This writes `memray-flamegraph-script.py.<pid>.html`.
|
|
27
|
+
|
|
28
|
+
4. Open the report in the browser:
|
|
29
|
+
- macOS: `open memray-flamegraph-script.py.<pid>.html`
|
|
30
|
+
- Linux: `xdg-open memray-flamegraph-script.py.<pid>.html`
|
|
31
|
+
- Either: `python -m webbrowser memray-flamegraph-script.py.<pid>.html`
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
|
|
35
|
+
- The `--temporal` flag (included in `memray-flame`) shows memory over time, not just peak — use this to spot leaks and allocation bursts.
|
|
36
|
+
- To find the `.bin` file if unsure of the name: `ls memray-*.bin`
|
|
37
|
+
- To compare runs, save the previous report: `cp memray-flamegraph-script.py.<pid>.html memray-flamegraph-before.html`
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: profimp
|
|
3
|
+
description: Profile Python import time using profimp and open a waterfall HTML report. Use when investigating slow startup or wanting to identify which imports are most expensive.
|
|
4
|
+
compatibility: Requires profimp (available as a pixi dependency). macOS or Linux.
|
|
5
|
+
allowed-tools: Bash(profimp:*) Bash(open:*) Bash(xdg-open:*) Bash(python -m webbrowser:*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Ask what to profile. Suggest common patterns for this repo:
|
|
11
|
+
- `import spatialdata`
|
|
12
|
+
- `from spatialdata import SpatialData`
|
|
13
|
+
- `from spatialdata_io import xenium`
|
|
14
|
+
|
|
15
|
+
2. Run:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
profimp --html "<import_stmt>" > /tmp/profimp.html
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. Open the report:
|
|
22
|
+
- macOS: `open /tmp/profimp.html`
|
|
23
|
+
- Linux: `xdg-open /tmp/profimp.html`
|
|
24
|
+
- Either: `python -m webbrowser /tmp/profimp.html`
|
|
25
|
+
|
|
26
|
+
## Notes
|
|
27
|
+
|
|
28
|
+
- The report is a waterfall chart showing every sub-import and its timing.
|
|
29
|
+
- To compare before/after: `cp /tmp/profimp.html /tmp/profimp-before.html` before re-running.
|
|
30
|
+
- `pixi run python -m profimp` also works if `profimp` is not on PATH.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pyspy
|
|
3
|
+
description: Profile the execution time of a Python script using py-spy and visualize the result with speedscope. Use when the user wants to benchmark performance, find slow code paths, or profile CPU time.
|
|
4
|
+
compatibility: Requires the pixi profiling environment (pixi run -e profiling). Speedscope must be installed separately (npm install -g speedscope). sudo is required on macOS.
|
|
5
|
+
allowed-tools: Bash(pixi run -e profiling pyspy:*) Bash(pixi run -e profiling speedscope:*) Bash(sudo pixi run -e profiling pyspy:*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Ask the user which script to profile (full or relative path).
|
|
11
|
+
|
|
12
|
+
2. Run py-spy to record the profile. The output is always written to `profile.speedscope.json` in the current directory.
|
|
13
|
+
|
|
14
|
+
**Linux** (no sudo needed):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pixi run -e profiling pyspy script.py
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**macOS** (sudo required — py-spy needs to attach to the process):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
sudo pixi run -e profiling pyspy script.py
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If sudo fails to find the pixi environment, use absolute paths:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
sudo /path/to/.pixi/envs/profiling/bin/py-spy record --gil \
|
|
30
|
+
-o profile.speedscope.json --format speedscope \
|
|
31
|
+
-- /path/to/.pixi/envs/profiling/bin/python script.py
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
3. Open the result in speedscope:
|
|
35
|
+
```bash
|
|
36
|
+
pixi run -e profiling speedscope
|
|
37
|
+
```
|
|
38
|
+
This opens `profile.speedscope.json` in the browser via the local speedscope CLI.
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- If the speedscope view is blank, switch threads using the thread selector in the top-right corner.
|
|
43
|
+
- To save a profile before overwriting: `cp profile.speedscope.json profile-before.speedscope.json`
|
|
44
|
+
- `--gil` records only time when the GIL is held (Python-level CPU time). Drop it to include C extension time.
|
|
45
|
+
- speedscope must be installed globally: `npm install -g speedscope`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Based on pydata/xarray
|
|
2
2
|
codecov:
|
|
3
|
-
require_ci_to_pass:
|
|
3
|
+
require_ci_to_pass: no
|
|
4
4
|
|
|
5
5
|
coverage:
|
|
6
6
|
status:
|
|
@@ -12,6 +12,6 @@ coverage:
|
|
|
12
12
|
changes: false
|
|
13
13
|
|
|
14
14
|
comment:
|
|
15
|
-
layout:
|
|
15
|
+
layout: diff, flags, files
|
|
16
16
|
behavior: once
|
|
17
|
-
require_base:
|
|
17
|
+
require_base: no
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"template": "https://github.com/scverse/cookiecutter-scverse",
|
|
3
|
+
"commit": "eb4523fde2e18bcfc121ff2cd722c9037ff8b910",
|
|
4
|
+
"checkout": "main",
|
|
5
|
+
"context": {
|
|
6
|
+
"cookiecutter": {
|
|
7
|
+
"project_name": "spatialdata",
|
|
8
|
+
"package_name": "spatialdata",
|
|
9
|
+
"project_description": "Spatial data format.",
|
|
10
|
+
"author_full_name": "scverse",
|
|
11
|
+
"author_email": "luca.marconato@scverse.org",
|
|
12
|
+
"github_user": "scverse",
|
|
13
|
+
"github_repo": "spatialdata",
|
|
14
|
+
"license": "BSD 3-Clause License",
|
|
15
|
+
"ide_integration": true,
|
|
16
|
+
"issue_categorization": "issue types",
|
|
17
|
+
"_copy_without_render": [
|
|
18
|
+
".github/workflows/build.yaml",
|
|
19
|
+
".github/workflows/test.yaml",
|
|
20
|
+
"docs/_templates/autosummary/**.rst"
|
|
21
|
+
],
|
|
22
|
+
"_exclude_on_template_update": [
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"README.md",
|
|
26
|
+
"docs/api.md",
|
|
27
|
+
"docs/index.md",
|
|
28
|
+
"docs/notebooks/example.ipynb",
|
|
29
|
+
"docs/references.bib",
|
|
30
|
+
"docs/references.md",
|
|
31
|
+
"src/**",
|
|
32
|
+
"tests/**"
|
|
33
|
+
],
|
|
34
|
+
"_render_devdocs": false,
|
|
35
|
+
"_jinja2_env_vars": {
|
|
36
|
+
"lstrip_blocks": true,
|
|
37
|
+
"trim_blocks": true
|
|
38
|
+
},
|
|
39
|
+
"_template": "https://github.com/scverse/cookiecutter-scverse",
|
|
40
|
+
"_commit": "eb4523fde2e18bcfc121ff2cd722c9037ff8b910"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"directory": null
|
|
44
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report something that is broken or incorrect
|
|
3
|
+
type: Bug
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
|
|
9
|
+
detailing how to provide the necessary information for us to reproduce your bug. In brief:
|
|
10
|
+
* Please provide exact steps how to reproduce the bug in a clean Python environment.
|
|
11
|
+
* In case it's not clear what's causing this bug, please provide the data or the data generation procedure.
|
|
12
|
+
* Replicate problems on public datasets or share data subsets when full sharing isn't possible.
|
|
13
|
+
|
|
14
|
+
Generally, the easier it is for us to reproduce the issue, the faster we can work on it. If you can, please:
|
|
15
|
+
|
|
16
|
+
1. Reproduce using the [`blobs` dataset](https://spatialdata.scverse.org/en/stable/api/datasets.html#spatialdata.datasets.blobs):
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from spatialdata.datasets import blobs
|
|
20
|
+
|
|
21
|
+
sdata = blobs()
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
You can also use [`blobs_annotating_element`](https://spatialdata.scverse.org/en/stable/api/datasets.html#spatialdata.datasets.blobs_annotating_element) for more control:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from spatialdata.datasets import blobs_annotating_element
|
|
28
|
+
|
|
29
|
+
sdata = blobs_annotating_element("blobs_labels")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. If the above is not possible, reproduce using a public dataset and explain how we can download the data.
|
|
33
|
+
3. If the data is private, consider sharing an anonymized version/subset via a [Zulip private message](https://scverse.zulipchat.com/#user/480560), or provide screenshots/GIFs showing the behavior.
|
|
34
|
+
|
|
35
|
+
Please report only one bug per issue.
|
|
36
|
+
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: report
|
|
39
|
+
attributes:
|
|
40
|
+
label: Report
|
|
41
|
+
description: A clear and concise description of what the bug is.
|
|
42
|
+
validations:
|
|
43
|
+
required: true
|
|
44
|
+
|
|
45
|
+
- type: textarea
|
|
46
|
+
id: versions
|
|
47
|
+
attributes:
|
|
48
|
+
label: Versions
|
|
49
|
+
description: |
|
|
50
|
+
Which version of packages.
|
|
51
|
+
|
|
52
|
+
Please install `session-info2`, run the following command in a notebook,
|
|
53
|
+
click the “Copy as Markdown” button, then paste the results into the text box below.
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
In[1]: import session_info2; session_info2.session_info(dependencies=True)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Alternatively, run this in a console:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
|
|
63
|
+
```
|
|
64
|
+
render: python
|
|
65
|
+
placeholder: |
|
|
66
|
+
anndata 0.11.3
|
|
67
|
+
---- ----
|
|
68
|
+
charset-normalizer 3.4.1
|
|
69
|
+
coverage 7.7.0
|
|
70
|
+
psutil 7.0.0
|
|
71
|
+
dask 2024.7.1
|
|
72
|
+
jaraco.context 5.3.0
|
|
73
|
+
numcodecs 0.15.1
|
|
74
|
+
jaraco.functools 4.0.1
|
|
75
|
+
Jinja2 3.1.6
|
|
76
|
+
sphinxcontrib-jsmath 1.0.1
|
|
77
|
+
sphinxcontrib-htmlhelp 2.1.0
|
|
78
|
+
toolz 1.0.0
|
|
79
|
+
session-info2 0.1.2
|
|
80
|
+
PyYAML 6.0.2
|
|
81
|
+
llvmlite 0.44.0
|
|
82
|
+
scipy 1.15.2
|
|
83
|
+
pandas 2.2.3
|
|
84
|
+
sphinxcontrib-devhelp 2.0.0
|
|
85
|
+
h5py 3.13.0
|
|
86
|
+
tblib 3.0.0
|
|
87
|
+
setuptools-scm 8.2.0
|
|
88
|
+
more-itertools 10.3.0
|
|
89
|
+
msgpack 1.1.0
|
|
90
|
+
sparse 0.15.5
|
|
91
|
+
wrapt 1.17.2
|
|
92
|
+
jaraco.collections 5.1.0
|
|
93
|
+
numba 0.61.0
|
|
94
|
+
pyarrow 19.0.1
|
|
95
|
+
pytz 2025.1
|
|
96
|
+
MarkupSafe 3.0.2
|
|
97
|
+
crc32c 2.7.1
|
|
98
|
+
sphinxcontrib-qthelp 2.0.0
|
|
99
|
+
sphinxcontrib-serializinghtml 2.0.0
|
|
100
|
+
zarr 2.18.4
|
|
101
|
+
asciitree 0.3.3
|
|
102
|
+
six 1.17.0
|
|
103
|
+
sphinxcontrib-applehelp 2.0.0
|
|
104
|
+
numpy 2.1.3
|
|
105
|
+
cloudpickle 3.1.1
|
|
106
|
+
sphinxcontrib-bibtex 2.6.3
|
|
107
|
+
natsort 8.4.0
|
|
108
|
+
jaraco.text 3.12.1
|
|
109
|
+
setuptools 76.1.0
|
|
110
|
+
Deprecated 1.2.18
|
|
111
|
+
packaging 24.2
|
|
112
|
+
python-dateutil 2.9.0.post0
|
|
113
|
+
---- ----
|
|
114
|
+
Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0]
|
|
115
|
+
OS Linux-6.11.0-109019-tuxedo-x86_64-with-glibc2.39
|
|
116
|
+
Updated 2025-03-18 15:47
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a new feature for spatialdata
|
|
3
|
+
type: Enhancement
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: description
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description of feature
|
|
9
|
+
description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: pre-commit
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
cooldown:
|
|
8
|
+
default-days: 7
|
|
9
|
+
groups:
|
|
10
|
+
pre-commit:
|
|
11
|
+
patterns: ["*"]
|
|
12
|
+
- package-ecosystem: github-actions
|
|
13
|
+
directory: /
|
|
14
|
+
schedule:
|
|
15
|
+
interval: weekly
|
|
16
|
+
cooldown:
|
|
17
|
+
default-days: 7
|
|
18
|
+
groups:
|
|
19
|
+
actions-deps:
|
|
20
|
+
patterns:
|
|
21
|
+
- "*"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# The workflow name is mandated by autofix.ci.
|
|
2
|
+
# It needs to be a dedicated workflow, as autofix.ci times out on long runs.
|
|
3
|
+
name: autofix.ci
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
FORCE_COLOR: "1"
|
|
10
|
+
UV_COMPILE_BYTECODE: "1"
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
name: Pre-commit checks
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
filter: blob:none
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
26
|
+
with:
|
|
27
|
+
enable-cache: true
|
|
28
|
+
- run: uv tool install hatch
|
|
29
|
+
- name: Run pre-commit hooks
|
|
30
|
+
run: uvx prek run --all-files --show-diff-on-failure --color=always
|
|
31
|
+
- uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4
|
|
32
|
+
if: ${{ !cancelled() }}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Check Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
package:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
21
|
+
with:
|
|
22
|
+
filter: blob:none
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: false
|
|
29
|
+
- name: Build package
|
|
30
|
+
run: uv build
|
|
31
|
+
- name: Check package
|
|
32
|
+
run: uvx twine check --strict dist/*.whl
|
|
@@ -2,8 +2,8 @@ name: Build Docker image
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
workflow_dispatch:
|
|
5
|
-
#
|
|
6
|
-
#
|
|
5
|
+
# schedule:
|
|
6
|
+
# - cron: "0 0 * * *" # run daily at midnight UTC
|
|
7
7
|
|
|
8
8
|
env:
|
|
9
9
|
REGISTRY: ghcr.io
|
|
@@ -13,6 +13,9 @@ concurrency:
|
|
|
13
13
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
14
|
cancel-in-progress: true
|
|
15
15
|
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
16
19
|
jobs:
|
|
17
20
|
build:
|
|
18
21
|
runs-on: ubuntu-latest
|
|
@@ -29,10 +32,13 @@ jobs:
|
|
|
29
32
|
|
|
30
33
|
steps:
|
|
31
34
|
- name: Checkout code
|
|
32
|
-
uses: actions/checkout@
|
|
35
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
36
|
+
with:
|
|
37
|
+
filter: blob:none
|
|
38
|
+
persist-credentials: false
|
|
33
39
|
|
|
34
40
|
- name: Set up Python
|
|
35
|
-
uses: actions/setup-python@
|
|
41
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
36
42
|
with:
|
|
37
43
|
python-version: "3.x"
|
|
38
44
|
|
|
@@ -77,13 +83,13 @@ jobs:
|
|
|
77
83
|
|
|
78
84
|
- name: Login to GitHub Container Registry
|
|
79
85
|
if: ${{ env.skip_build == 'false' }}
|
|
80
|
-
uses: docker/login-action@
|
|
86
|
+
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
|
81
87
|
with:
|
|
82
88
|
registry: ${{ env.REGISTRY }}
|
|
83
89
|
username: ${{ github.actor }}
|
|
84
90
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
85
91
|
|
|
86
|
-
- uses: docker/build-push-action@
|
|
92
|
+
- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
|
|
87
93
|
if: ${{ env.skip_build == 'false' }}
|
|
88
94
|
env:
|
|
89
95
|
IMAGE_TAG: ${{ env.REGISTRY }}/scverse/spatialdata:${{ env.IMAGE_TAG_SUFFIX }}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
|
|
8
|
+
permissions: {}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
name: Upload release to PyPI
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
environment:
|
|
15
|
+
name: pypi
|
|
16
|
+
url: https://pypi.org/p/spatialdata
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
22
|
+
with:
|
|
23
|
+
filter: blob:none
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
persist-credentials: false
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
28
|
+
with:
|
|
29
|
+
enable-cache: false
|
|
30
|
+
- name: Build package
|
|
31
|
+
run: uv build
|
|
32
|
+
- name: Publish package distributions to PyPI
|
|
33
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "0 5 1,15 * *"
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
# [tool.hatch.envs.hatch-test.matrix] in pyproject.toml is the single source of truth: the same environments run here and locally.
|
|
20
|
+
get-environments:
|
|
21
|
+
runs-on: ubuntu-slim
|
|
22
|
+
outputs:
|
|
23
|
+
envs: ${{ steps.get-envs.outputs.envs }}
|
|
24
|
+
steps:
|
|
25
|
+
- &clone
|
|
26
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
27
|
+
with:
|
|
28
|
+
filter: blob:none
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
- &setup-uv
|
|
32
|
+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
33
|
+
with:
|
|
34
|
+
prune-cache: true
|
|
35
|
+
- name: Get test environments
|
|
36
|
+
id: get-envs
|
|
37
|
+
run: |
|
|
38
|
+
ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
|
|
39
|
+
| map(
|
|
40
|
+
select(.key | startswith("hatch-test"))
|
|
41
|
+
| {
|
|
42
|
+
name: .key,
|
|
43
|
+
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
|
|
44
|
+
python: .value.python
|
|
45
|
+
}
|
|
46
|
+
)')
|
|
47
|
+
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
|
|
48
|
+
|
|
49
|
+
test:
|
|
50
|
+
needs: get-environments
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write # for codecov OIDC
|
|
53
|
+
contents: read
|
|
54
|
+
|
|
55
|
+
strategy:
|
|
56
|
+
fail-fast: false
|
|
57
|
+
matrix:
|
|
58
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
59
|
+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
|
|
60
|
+
|
|
61
|
+
name: ${{ matrix.env.label }} (${{ matrix.os }})
|
|
62
|
+
runs-on: ${{ matrix.os }}
|
|
63
|
+
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
|
|
64
|
+
env:
|
|
65
|
+
UV_PYTHON: ${{ matrix.env.python }}
|
|
66
|
+
|
|
67
|
+
steps:
|
|
68
|
+
- *clone
|
|
69
|
+
- *setup-uv
|
|
70
|
+
- name: create hatch environment
|
|
71
|
+
run: uvx hatch env create ${{ matrix.env.name }}
|
|
72
|
+
- name: list all all installed package versions
|
|
73
|
+
run: uvx hatch run ${{ matrix.env.name }}:uv pip list
|
|
74
|
+
- name: run tests using hatch
|
|
75
|
+
env:
|
|
76
|
+
MPLBACKEND: agg
|
|
77
|
+
PLATFORM: ${{ matrix.os }}
|
|
78
|
+
DISPLAY: :42
|
|
79
|
+
run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto --dist worksteal --run-network
|
|
80
|
+
- name: generate coverage report
|
|
81
|
+
run: |
|
|
82
|
+
# See https://coverage.readthedocs.io/page/config.html#run-patch
|
|
83
|
+
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
|
|
84
|
+
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
|
|
85
|
+
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
|
|
86
|
+
- name: Upload coverage
|
|
87
|
+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
88
|
+
with:
|
|
89
|
+
fail_ci_if_error: true
|
|
90
|
+
use_oidc: true
|
|
91
|
+
|
|
92
|
+
# One required check for branch protection, so it does not need updating whenever the matrix changes.
|
|
93
|
+
check:
|
|
94
|
+
name: Tests pass in all hatch environments
|
|
95
|
+
if: always()
|
|
96
|
+
needs:
|
|
97
|
+
- get-environments
|
|
98
|
+
- test
|
|
99
|
+
runs-on: ubuntu-latest
|
|
100
|
+
steps:
|
|
101
|
+
- uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
|
|
102
|
+
with:
|
|
103
|
+
jobs: ${{ toJSON(needs) }}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# Temp files
|
|
2
2
|
.DS_Store
|
|
3
3
|
*~
|
|
4
|
+
buck-out/
|
|
4
5
|
.dmypy.json
|
|
6
|
+
temp/
|
|
5
7
|
|
|
6
8
|
# Compiled files
|
|
9
|
+
.venv/
|
|
10
|
+
uv.lock
|
|
11
|
+
pixi.lock
|
|
7
12
|
__pycache__/
|
|
13
|
+
.*cache/
|
|
8
14
|
|
|
9
15
|
# Distribution / packaging
|
|
10
16
|
/build/
|
|
@@ -12,27 +18,23 @@ __pycache__/
|
|
|
12
18
|
/*.egg-info/
|
|
13
19
|
|
|
14
20
|
# Tests and coverage
|
|
15
|
-
/.pytest_cache/
|
|
16
|
-
/.cache/
|
|
17
21
|
/data/
|
|
22
|
+
/node_modules/
|
|
23
|
+
/.coverage*
|
|
24
|
+
/coverage.xml
|
|
18
25
|
|
|
19
26
|
# docs
|
|
20
|
-
docs/
|
|
21
|
-
|
|
22
|
-
docs/**/generated
|
|
27
|
+
/docs/generated/
|
|
28
|
+
/docs/_build/
|
|
29
|
+
docs/**/generated/
|
|
23
30
|
docs/_static/datasets_data.js
|
|
24
31
|
|
|
25
32
|
# IDEs
|
|
26
33
|
/.idea/
|
|
27
|
-
.vscode
|
|
28
34
|
|
|
29
35
|
# data
|
|
30
36
|
*.zarr/
|
|
31
37
|
|
|
32
|
-
# temp files
|
|
33
|
-
temp/
|
|
34
|
-
|
|
35
|
-
|
|
36
38
|
# symlinks (luca) for extending the refactoring to satellite projects
|
|
37
39
|
napari-spatialdata
|
|
38
40
|
spatialdata-io
|
|
@@ -46,11 +48,9 @@ spatialdata-sandbox
|
|
|
46
48
|
# version file
|
|
47
49
|
_version.py
|
|
48
50
|
|
|
49
|
-
#
|
|
50
|
-
|
|
51
|
+
# agents configurations
|
|
52
|
+
.claude/settings.local.json
|
|
51
53
|
|
|
54
|
+
# benchmarking and profiling
|
|
52
55
|
.asv/
|
|
53
|
-
|
|
54
|
-
.mypy_cache
|
|
55
|
-
.ruff_cache
|
|
56
|
-
uv.lock
|
|
56
|
+
profile.speedscope.json
|