-
-
Notifications
You must be signed in to change notification settings - Fork 328
Backwards compatibility for reading Array.filters and Array.codecs #2194
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
Comments
Unfortunately, no. This was discussed in an earlier discussion here: #1944.
Probably the place to look for this functionality would be the classes that adapt the v2 compressor / filters to the v3 codecs api: zarr-python/src/zarr/codecs/_v2.py Line 69 in fbd1658
In |
(xref to the issue tracking the top-level codecs / filters / compressor api): #1943 |
Thanks for those links. I'll try to digest them and will propose a plan that'll either be compatibility code, or (more likely?) a PR to the migration guide. |
I think we can close this now. @TomAugspurger - feel free to reopen if you feel that #2652 and #2463 didn't quite hit the mark. |
Looks good! |
Zarr version
v3
Numcodecs version
n/a
Python Version
n/a
Operating System
n/a
Installation
n/a
Description
As part of getting xarray ready for zarr v3, I'm looking at how to handle the codec and filter API.
The primary / first place this is accessed is https://github.com/pydata/xarray/blob/1c6300c415efebac15f5ee668a3ef6419dbeab63/xarray/backends/zarr.py#L555-L556, which just reads the values of
.filters
and.compressor
to place them in theDataArray.encoding
. A few questions:.codecs
property to theCodecPipeline
ABC. This is fine for theBatchedCodecPipeline
which AFAICT is the only actual codec pipeline. Does anyone foresee an issue with that? I'm not sure why that class is abstract and loadable through the config.filters
is the same asarray_array_codecs
?compressor
is the same asarray_bytes_codecs
?There's also https://github.com/pydata/xarray/blob/1c6300c415efebac15f5ee668a3ef6419dbeab63/xarray/backends/zarr.py#L79, which accesses
Codec.codec_id
. I'm not sure yet about how to handle that, but right now the best is maybe.to_dict()["name"]
(or we could have.to_dict()
access a code_id)?Steps to reproduce
n/a
Additional output
No response
The text was updated successfully, but these errors were encountered: