Skip to content

Conversation

@MSHelm
Copy link
Contributor

@MSHelm MSHelm commented Dec 12, 2025

I tried my hand to fix #1030

This should handle all instances where we want to have a DataArray after parsing a RasterSchema model. For DataTrees the chunking is handled in to_multiscale

As I am new to your codebase I hope I adhered to all your guidelines. If not I am happy about any comments what I could improve.

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.20%. Comparing base (53b9438) to head (e648432).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1031      +/-   ##
==========================================
+ Coverage   92.11%   92.20%   +0.08%     
==========================================
  Files          49       49              
  Lines        7537     7547      +10     
==========================================
+ Hits         6943     6959      +16     
+ Misses        594      588       -6     
Files with missing lines Coverage Δ
src/spatialdata/models/models.py 88.61% <100.00%> (+0.04%) ⬆️

... and 5 files with indirect coverage changes

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

elif isinstance(data, np.ndarray | DaskArray):
if not isinstance(data, DaskArray): # numpy -> dask
data = from_array(data)
data = from_array(data.data)
Copy link
Member

Choose a reason for hiding this comment

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

why this change?

Copy link
Member

Choose a reason for hiding this comment

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

I'll revert and merge but happy to patch later in case it's needed.

@LucaMarconato
Copy link
Member

Great work and thanks for the PR!

I added cases to the tests to cover also the cases in which the data is a dask array or a numpy array, and I added tests for the multiscale case.

Copy link
Member

@LucaMarconato LucaMarconato left a comment

Choose a reason for hiding this comment

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

Great work! Made some changes and merging now.

@LucaMarconato LucaMarconato enabled auto-merge (squash) December 30, 2025 21:28
@LucaMarconato LucaMarconato merged commit 17f8a39 into scverse:main Dec 30, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The chunks parameter is ignored for DataArray models inheriting from RasterSchema

2 participants