Backend specific conventions decoding
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Currently, we have a single function xarray.decode_cf() that we apply to data loaded from all xarray backends.
This is appropriate for netCDF data, but it's not appropriate for backends with different implementations. For example, it doesn't work for zarr (which is why we have the separate open_zarr), and is also a poor fit for PseudoNetCDF (https://github.com/pydata/xarray/pull/1905). In the worst cases (e.g., for PseudoNetCDF) it can actually result in data being decoded twice, which can result in incorrectly scaled data.
Instead, we should declare default decoders as part of the backend API, and use those decoders as the defaults for open_dataset().
This should probably be tackled as part of the broader backends refactor: https://github.com/pydata/xarray/issues/1970
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 with the broader backends refactor in issue #1970, then trace xarray.decode_cf(), open_zarr(), and open_dataset() in the xarray backend API. Compare the netCDF, zarr, and PseudoNetCDF behavior described here; done means backend-specific default decoders are defined and open_dataset() uses them without double decoding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100