-
Notifications
You must be signed in to change notification settings - Fork 78
use chunks parameter for dataarray models #1031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use chunks parameter for dataarray models #1031
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
src/spatialdata/models/models.py
Outdated
| elif isinstance(data, np.ndarray | DaskArray): | ||
| if not isinstance(data, DaskArray): # numpy -> dask | ||
| data = from_array(data) | ||
| data = from_array(data.data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
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.
|
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. |
LucaMarconato
left a comment
There was a problem hiding this 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.
I tried my hand to fix #1030
This should handle all instances where we want to have a
DataArrayafter parsing aRasterSchemamodel. ForDataTreesthe chunking is handled into_multiscaleAs 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.