Enable object_codec in zarr backend
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
What is your issue?
The issue is that I am not able to define a custom object codec and use it for encoding particular variables in an xarray Dataset. I found a workaround that requires small changes to two files as follows.
Currently in the zarr backend of xarray, the allowed keys in the encoding dictionary are
{
"chunks",
"compressor",
"filters",
"cache_metadata",
"write_empty_chunks",
}
Would it be possible to add object_codec to enable the use of custom codecs on object datatypes (change in xarray/backends/zarr.py)? Also would require ensure_dtype_not_object to be removed from conventions.py and placed in the backends as the TODO there suggests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in xarray/backends/zarr.py by reviewing the allowed encoding keys, then follow the TODO concerning ensure_dtype_not_object in conventions.py. The work is complete when custom object codecs can be supplied for selected object-dtype variables and the related dtype handling is located in the backend as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100