xarray-contrib / xarray-contrib/xdggs
Errors with assign_latlon_coords() and sel_latlon() after updating xarray
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 138
- Forks
- 25
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 11
Description
Environment:
xarray version: 2024.3.0 (errors observed), 2023.12.0 (errors observed), 2023.10.1 (working)
xdggs version: [specify version if known]
Python version: 3.11
Operating System: Mac (works with xarray 2023.10.1) & on https://pangeo-eosc.vm.fedcloud.eu/ (not working.)
Description:
I have encountered issues with the xdggs library functions assign_latlon_coords() and sel_latlon() after updating xarray to newer versions. The functions worked as expected with xarray version 2023.10.1 but fail with versions 2024.3.0 and 2023.12.0.
To Reproduce:
I tested using the notebook available at:
https://github.com/xarray-contrib/xdggs/blob/main/examples/example_healpy.ipynb
** Issue 1:**
ds_idx.dggs.sel_latlon([48.0, 48.1], -5.0) causes a crash with the following traceback:
KeyError: "not all values found in index 'cell_ids'"
at File "/srv/conda/envs/notebook/lib/python3.11/site-packages/xarray/core/indexes.py:784, in PandasIndex.sel(self, labels, method, tolerance)
** Issue 2:**
ds_idx.dggs.assign_latlon_coords() also results in an error:
ValueError: too many values to unpack (expected 2)
at File "/srv/conda/envs/notebook/lib/python3.11/site-packages/xdggs/accessor.py:79, in DGGSAccessor.assign_latlon_coords(self)
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 examples/example_healpy.ipynb and reproduce both failures using the listed xarray versions. Inspect xdggs/accessor.py around line 79 and the implementation paths for sel_latlon() and assign_latlon_coords(). Done means the notebook works with the affected newer versions without the reported KeyError or ValueError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100