xarray-contrib / xdggs

Xarray extension for DGGS
Apache License 2.0
54 stars 9 forks source link

Errors with assign_latlon_coords() and sel_latlon() after updating xarray #53

Open tinaok opened 4 months ago

tinaok commented 4 months ago

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)
スクリーンショット 2024-05-05 15 39 10

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)
スクリーンショット 2024-05-05 15 40 16