Remove xarray-schema; validate() are now class methods#1066
Remove xarray-schema; validate() are now class methods#1066LucaMarconato merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the xarray-schema dependency (addressing import failures with newer setuptools) and makes model validate() APIs consistent by moving them to class methods, while replacing raster validation with in-house checks.
Changes:
- Removed
xarray-schemafrom dependencies and replaced raster schema validation with custom validation logic. - Converted raster and table model validation calls to
Model.validate(...)(classmethod-style) across code and tests. - Updated raster dimension handling from
model.dims.dimstomodel.dims.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/models/test_models.py | Updates tests to use classmethod validation and new dims representation. |
| tests/io/test_multi_table.py | Switches table validation call sites to TableModel.validate(...). |
| src/spatialdata/models/models.py | Removes xarray-schema, implements custom raster validation, converts TableModel.validate and helpers to classmethods, adds deprecation warnings for instantiation. |
| src/spatialdata/models/_utils.py | Updates channel-name validation to use model.dims (tuple) directly. |
| src/spatialdata/_utils.py | Fixes typing for dims to tuple[str, ...]. |
| src/spatialdata/_io/io_table.py | Updates table validation to classmethod call. |
| src/spatialdata/_core/spatialdata.py | Updates table validation + helper validation calls to classmethod style. |
| src/spatialdata/_core/operations/transform.py | Uses schema.validate(...) instead of instantiating schema. |
| src/spatialdata/_core/operations/rasterize.py | Uses schema.validate(...) instead of instantiating schema. |
| src/spatialdata/_core/_elements.py | Uses classmethod validation when inserting elements. |
| src/spatialdata/_core/_deepcopy.py | Uses classmethod validation for multiscale raster deepcopy. |
| pyproject.toml | Drops xarray-schema from runtime dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1066 +/- ##
==========================================
- Coverage 92.24% 91.89% -0.36%
==========================================
Files 49 49
Lines 7594 7598 +4
==========================================
- Hits 7005 6982 -23
- Misses 589 616 +27
🚀 New features to boost your workflow:
|
|
Btw this PR may decrease the import time of |
Closes #1065
Closes #977
Closes #528