Skip to content

Conversation

@LucaMarconato
Copy link
Member

Closes #1065
Closes #977
Closes #528

@LucaMarconato LucaMarconato marked this pull request as ready for review February 9, 2026 11:16
@LucaMarconato LucaMarconato requested a review from Copilot February 9, 2026 11:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-schema from 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.dims to model.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
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.89%. Comparing base (3cdf3d8) to head (45e3e33).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata/models/models.py 88.63% 10 Missing ⚠️
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     
Files with missing lines Coverage Δ
src/spatialdata/_core/_deepcopy.py 98.38% <100.00%> (ø)
src/spatialdata/_core/_elements.py 92.13% <100.00%> (ø)
src/spatialdata/_core/operations/rasterize.py 90.16% <100.00%> (ø)
src/spatialdata/_core/operations/transform.py 91.37% <100.00%> (ø)
src/spatialdata/_core/spatialdata.py 91.93% <100.00%> (-0.04%) ⬇️
src/spatialdata/_io/io_table.py 90.24% <100.00%> (ø)
src/spatialdata/_utils.py 84.50% <ø> (ø)
src/spatialdata/models/_utils.py 89.20% <100.00%> (ø)
src/spatialdata/models/models.py 88.42% <88.63%> (-0.57%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaMarconato LucaMarconato merged commit e88c24e into main Feb 9, 2026
9 checks passed
@LucaMarconato LucaMarconato deleted the remove/xarray-schema branch February 9, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant