fix: point table validation to public sanitizer - #1
Draft
stanbot8 wants to merge 13 commits into
Draft
Conversation
stanbot8
force-pushed
the
fix/1154-sanitize-table-path
branch
from
July 24, 2026 13:16
35c771b to
63a5780
Compare
Fix typo in documentation
…erse#1174) Fix contributor dependency installation
* chore: added prek to dev deps * feat: writing table to zarr using AnnData.write_zarr for table version 2 * chore: added ruff to dev deps * fix: using internal resolve store function + categorical when writing tables to zarr v2 * fix: test no longer expectes 'nan' after table round trip instead of pd.NA/np.nan * feat: added hatch env configs for testing version combinations of anndata/pandas * feat: update hatch config for testing pandas/anndata versions * feat: added DeprecationWarnings when writing to zarr v2 * fix: if-raise instead of assert * refac + doc: pyproject.toml * fix: made version comparison of anndata more robust * fix: doc string * fix: made converting table strings to categorical optional + non-default * feat: documentation strings * feat: revised tests to work with new write parameter * fix: removed unnecessary redeclaration of table group * fix: doc string improvements * chore: docs touch-up; removed unnecessary .copy() --------- Co-authored-by: Luca Marconato <m.lucalmer@gmail.com> Co-authored-by: LucaMarconato <2664412+LucaMarconato@users.noreply.github.com>
* Add downloadable cells dataset via scverse-misc Expose spatialdata.datasets.cells() alongside blobs/raccoon. It downloads the cells example dataset and loads it as a SpatialData object, reusing the scverse-misc datasets infrastructure (parse_registry + fetch with the built-in spatialdata loader) rather than reimplementing a downloader. - ship src/spatialdata/datasets.yaml registry (base_url + cells.zip sha256) - add scverse-misc[datasets]>=0.0.10 dependency - bump requires-python and ruff target to 3.12 (scverse-misc requires >=3.12) - update CI matrix 3.11 -> 3.12 - docs + network-free registry test and a slow download test Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix mypy no-any-return in cells() Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Bump scverse-misc pin to >=0.1.0 (first released datasets version) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Add license and attribution to cells dataset registry The cells dataset is derived from the 10x Genomics Xenium Prime Cervical Cancer FFPE sample, released under CC BY 4.0 (attribution required). Record the license and attribution in the registry and document the expectation that every dataset lists its license. * refactor(datasets): address review on cells() Extract _shipped_registry() and _cache_dir() helpers, shared between cells() and the tests, removing the duplicated registry-parsing block. _cache_dir() isolates the path-vs-default branch so both sides are covered without a network call. Describe the dataset contents in the docstring, and assert the concrete element counts and shapes in test_cells_download. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(datasets): satisfy mypy no-any-return in _shipped_registry parse_registry is untyped in the mypy env, so returning its result directly tripped no-any-return; assign through annotated locals. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: improve attribution and license info * test(datasets): gate network test behind opt-in `network` marker Rename the `slow` marker to `network` and flip it from opt-out (`-m "not slow"`) to opt-in: tests marked `network` are skipped unless `--run-network` is passed. Enable the flag in CI so `test_cells_download` runs there, and document the `license_url` convention for CC-BY-style datasets in datasets.yaml. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Luca Marconato <m.lucalmer@gmail.com> Co-authored-by: LucaMarconato <2664412+LucaMarconato@users.noreply.github.com>
updates: - [github.com/rbubley/mirrors-prettier: v3.9.4 → v3.9.6](rbubley/mirrors-prettier@v3.9.4...v3.9.6) - [github.com/pre-commit/mirrors-mypy: v2.1.0 → v2.3.1](pre-commit/mirrors-mypy@v2.1.0...v2.3.1) - [github.com/astral-sh/ruff-pre-commit: v0.15.20 → v0.16.3](astral-sh/ruff-pre-commit@v0.15.20...v0.16.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* docs: add interoperability page Closes scverse#1176. Adds a short Interoperability page listing non-Python interfaces to the SpatialData on-disk format, mirroring the equivalent pages in anndata and mudata so the style is consistent across the three data structures. Also notes that the format builds on OME-NGFF and points at the design document for the current on-disk layout. * chore: fix precommit --------- Co-authored-by: Luca Marconato <m.lucalmer@gmail.com>
… landing page (scverse#1179) docs: fix package name and R repository link on landing page - `napari-spatialdata-repo` -> `napari-spatialdata`: the bullet label had leaked the Markdown link-reference name into the rendered package name. - The R implementation has been renamed from `SpatialData` to `spatialdataR`; update both the displayed name and the repository link, which previously only resolved via GitHub's rename redirect.
…#1181) Test suite tried to force-disable numba JIT when already imported by patching `NUMBA_DISABLE_JIT` on numba.core.config, but numba internally reads the env var into an attribute named `DISABLE_JIT` (no prefix). We should find a less hacky solution to this, but for now, running the tests sequentially (`pytest -x`) always pass. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: LucaMarconato <2664412+LucaMarconato@users.noreply.github.com>
scverse#1169) * docs: add docstrings to BaseTransformation.inverse() and to_affine_matrix() Addresses issue scverse#836 - adds missing docstrings to abstract methods in BaseTransformation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs: small fixes to docstrings --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: LucaMarconato <2664412+LucaMarconato@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preview. Text in square brackets becomes links in the submission.
Summary
The table-name validation error in issue [issue 1154] points to
spatialdata.utils.sanitize_table(adata). This path does not exist. The error now points tospatialdata.sanitize_table(adata). Closes issue 1154.Design
Use the top-level function that
spatialdataexports. Keep validation and sanitization behavior unchanged.The implementation changes [
src/spatialdata/_core/validation.py].Limitations
This change does not add a compatibility alias for the invalid
spatialdata.utilspath.Tests
The regression test fails on
mainand passes on this branch. The full suite passes with 1,365 tests, 7 skips, and 1 expected failure. The installed wheel passes the reported sanitize-and-validate workflow.The tests are in [
tests/models/test_models.py].All 7 [CPU matrix jobs] passed.
Commands
uv run pytest tests/models/test_models.py::TestModels::test_table_model_invalid_name_suggests_public_sanitizer -q