-
Notifications
You must be signed in to change notification settings - Fork 15
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
Basic rechunking example #539
Comments
What you're doing is correct, you should be able to use all the Xarray syntax you normally would without called anything from Cubed directly. Using the .chunk method on Xarray is supposed to be viable but there is at least one bug in cubed-xarray that was found earlier today (see PR on cubed-xarray). There may be another bug here! Cubed-xarray is currently under-tested relative to Cubed alone. |
Okay so > rds = ds.chunk({'time':1}, chunked_array_type="cubed") You should not need to add I'm also able to reproduce your the bug with writing out the wrong chunks. However when I instead try writing out just one array using cubed.to_zarr(rds['air'].data, ts) Which at least means the bug is in xarray / cubed-xarray rather than in cubed. |
Ah good to know it's probably a cubed-xarray bug. Would it be helpful to repost/move the issue there or cross ref it? |
Thanks for your patience! Cross-referencing it in a new issue on cubed-xarray could be helpful. |
I tracked down the problem - this seems to fix it: pydata/xarray#9326 |
The Xarray issue has been merged now so it might be worth seeing if it fixes your original issue @norlandrhagen. |
Just tried with the main Xarray branch and it worked! 🎈 Thanks for the fix. Is it worth pinning |
Great!
That might be a good idea. |
Yes definitely. I'm also about to suggest we rename the |
Working my way through understanding cubed / cubed-xarray.
I'm trying to get an example working of modifying the chunking of an Xarray dataset and writing it to Zarr. When I roundtrip the Zarr to and from Xarray, it seems like the chunking structure hasn't changed. Is using the
.chunk
method on an Xarray dataset with cubed viable or should I be using rechunk primitive?Roundtrip example using Xarray + dask chunks
Roundtrip example using Xarray + cubed
chunked dataset (rds):
![image](https://private-user-images.githubusercontent.com/22455466/355264189-adf38853-1415-4b64-81de-f888429ed62b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzUxNzUsIm5iZiI6MTczOTAzNDg3NSwicGF0aCI6Ii8yMjQ1NTQ2Ni8zNTUyNjQxODktYWRmMzg4NTMtMTQxNS00YjY0LTgxZGUtZjg4ODQyOWVkNjJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE3MTQzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiM2ZkMjIxMTUwMjlkOWJiOTMyZjI4MjZiODZhYWU1NzRjMTBiYTljOWE2Yjg0MTc4ZWFkMDkyYWQ2NTZjYTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CH115VgHTOrrAUDGZLFKJdQS-J84XscvrJgwzSpo_uM)
roundtripped dataset (rtds):
![image](https://private-user-images.githubusercontent.com/22455466/355264259-72857cb1-68e7-4681-bfcd-110141c86c40.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzUxNzUsIm5iZiI6MTczOTAzNDg3NSwicGF0aCI6Ii8yMjQ1NTQ2Ni8zNTUyNjQyNTktNzI4NTdjYjEtNjhlNy00NjgxLWJmY2QtMTEwMTQxYzg2YzQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE3MTQzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJiNGE4ZmU4ZWI4Y2UxNThlMjIyMGI3MTUwNTVkMGM1OTI1OWVmNDQ5NWM3ZWRjNTcwYzM2NTM0MjI1Y2M5NGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.m_90y995F9dPj7av7U03ljwFEYPDcovVwwyX8gNwvvM)
🤞 this is an end-of-day brain implementation issue on my end.
The text was updated successfully, but these errors were encountered: