Testing of to/from xarray
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 150
- Forks
- 23
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 2
Description
We now have cf.Field.to_xarray (#933), but we don't test if the contents of the created xarray.Dataset or xarwray.DataTree objects is any good. However, due in the August 2026 release, we will also have the ability to create cf.Field instance from xarray objects. We can then test the round-trip of cf.Field -> xr.Dataset -> cf.Field. It is likely (?) that the round trip won't be perfect, but the imperfections will be understood, so we should be able to test where we expect things to look the same.
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 cf.Field.to_xarray (#933) and inspect how xarray.Dataset and xarray.DataTree objects are produced. Then follow the planned path for creating cf.Field from xarray objects. Add round-trip tests that assert the expected similarities and explicitly capture understood imperfections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100