Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDMRemote xarray wrapper broken with xarray 2024.03.0 #761

Open
dcamron opened this issue Apr 29, 2024 · 0 comments
Open

CDMRemote xarray wrapper broken with xarray 2024.03.0 #761

dcamron opened this issue Apr 29, 2024 · 0 comments

Comments

@dcamron
Copy link
Member

dcamron commented Apr 29, 2024

CMDRemote xarray access is currently broken on xarray==2024.03.0,

catalog_url = "https://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p5deg_ana/catalog.xml"
catalog = TDSCatalog(catalog_url)
catalog.datasets["Latest Collection for GFS Half Degree Analysis"].remote_access(use_xarray=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

...

File [~/mambaforge/envs/metpy-analysis/lib/python3.11/site-packages/siphon/cdmr/xarray_support.py:41](http://localhost:8888/~/mambaforge/envs/metpy-analysis/lib/python3.11/site-packages/siphon/cdmr/xarray_support.py#line=40), in CDMArrayWrapper.__getitem__(self, item)
     40 if len(np_inds.tuple) > 0:
---> 41     array = indexing.NumpyIndexingAdapter(array)[np_inds]
     43 return array

File [~/mambaforge/envs/metpy-analysis/lib/python3.11/site-packages/xarray/core/indexing.py:1484](http://localhost:8888/~/mambaforge/envs/metpy-analysis/lib/python3.11/site-packages/xarray/core/indexing.py#line=1483), in NumpyIndexingAdapter.__getitem__(self, indexer)
   1483 def __getitem__(self, indexer: ExplicitIndexer):
-> 1484     self._check_and_raise_if_non_basic_indexer(indexer)
   1486     array = self.array

File [~/mambaforge/envs/metpy-analysis/lib/python3.11/site-packages/xarray/core/indexing.py:524](http://localhost:8888/~/mambaforge/envs/metpy-analysis/lib/python3.11/site-packages/xarray/core/indexing.py#line=523), in ExplicitlyIndexedNDArrayMixin._check_and_raise_if_non_basic_indexer(self, indexer)
    523 if isinstance(indexer, (VectorizedIndexer, OuterIndexer)):
--> 524     raise TypeError(
    525         "Vectorized indexing with vectorized or outer indexers is not supported. "
    526         "Please use .vindex and .oindex properties to index the array."
    527     )

TypeError: Vectorized indexing with vectorized or outer indexers is not supported. Please use .vindex and .oindex properties to index the array.

which works on xarray==2024.02.0.

Looks to come from underlying indexing changes in or around pydata/xarray#8790.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant