Closed mraspaud closed 11 months ago
chunks
is not used by xarray, however it is used by rioxarray
. See: https://github.com/corteva/rioxarray/blob/33c0059ae97f108d631dad2ede721f5a0d4c18dc/rioxarray/_io.py#L896-L929
chunks
is not used by xarray, however it is used byrioxarray
. See:
Indeed! my objective here is to return the LazilyIndexedOuterArrays to xarray directly when the data is requested through the xarray backend to let xarray deal with the chunking and create dask arrays itself.
Anything else I can do to get this PR ready to merge?
Mind adding a note in docs/history.rst
?
@mraspaud, the only thing left to do in this PR is to remove the changes in the .pre-commit-config.yaml
file and resolve the conflicts. The optimal chunk size can be updated separately.
Done. Sorry for the delay, I was on holidays...
This looks good from my perspective, Any other changes you would like to add before merging?
Nothing more from my side, thanks for all the support!
Thanks @mraspaud 👍
This PR proposes a removes the (unused)
chunks
andcache
argument from theopen_dataset
plugin function and sends values toopen_rasterio
to get a result inline with what xarray expects. Moreover, thepreferred_chunks
encoding attribute is populated for xarray to be able to do optimized automated chunking.The fact that
chunks
andcache
are ignored by xarray is documented in the example here: https://docs.xarray.dev/en/stable/internals/how-to-add-new-backend.html#backendentrypoint-subclassing And the recommended usage ofpreferred_chunks
is documented here: https://docs.xarray.dev/en/stable/internals/how-to-add-new-backend.html#preferred-chunk-sizesFinally, I wasn't really sure how/where to put the tests, what do you recommend?
docs/history.rst
for all changes anddocs/rioxarray.rst
for new API