issues: 787947436
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
787947436 | MDU6SXNzdWU3ODc5NDc0MzY= | 4822 | h5netcdf fails to decode attribute coordinates. | 40218891 | closed | 0 | 10 | 2021-01-18T06:01:40Z | 2022-03-29T13:39:46Z | 2022-03-29T13:39:45Z | NONE | What happened:
The engine What you expected to happen: It should work. Minimal Complete Verifiable Example: ```python Put your MCVE code hereimport xarray as xr ds = xr.open_dataset('/tmp/x.nc', engine='h5netcdf') ========H5 coordinates ['x y'] AttributeError Traceback (most recent call last) <ipython-input-3-481117dce7ff> in <module> 1 import xarray as xr 2 ----> 3 ds = xr.open_dataset('/tmp/x.nc', engine='h5netcdf') ~/miniconda3/envs/aws/lib/python3.7/site-packages/xarray/backends/api.py in open_dataset(filename_or_obj, group, decode_cf, mask_and_scale, decode_times, autoclose, concat_characters, decode_coords, engine, chunks, lock, cache, drop_variables, backend_kwargs, use_cftime, decode_timedelta) 572 573 with close_on_error(store): --> 574 ds = maybe_decode_store(store, chunks) 575 576 # Ensure source filename always stored in dataset object (GH issue #2550) ~/miniconda3/envs/aws/lib/python3.7/site-packages/xarray/backends/api.py in maybe_decode_store(store, chunks) 476 drop_variables=drop_variables, 477 use_cftime=use_cftime, --> 478 decode_timedelta=decode_timedelta, 479 ) 480 ~/miniconda3/envs/aws/lib/python3.7/site-packages/xarray/conventions.py in decode_cf(obj, concat_characters, mask_and_scale, decode_times, decode_coords, drop_variables, use_cftime, decode_timedelta) 596 drop_variables=drop_variables, 597 use_cftime=use_cftime, --> 598 decode_timedelta=decode_timedelta, 599 ) 600 ds = Dataset(vars, attrs=attrs) ~/miniconda3/envs/aws/lib/python3.7/site-packages/xarray/conventions.py in decode_cf_variables(variables, attributes, concat_characters, mask_and_scale, decode_times, decode_coords, drop_variables, use_cftime, decode_timedelta) 504 if "coordinates" in var_attrs: 505 coord_str = var_attrs["coordinates"] --> 506 var_coord_names = coord_str.split() 507 if all(k in variables for k in var_coord_names): 508 new_vars[k].encoding["coordinates"] = coord_str AttributeError: 'numpy.ndarray' object has no attribute 'split' ``` Anything else we need to know?: The test file was created from CDL: ``` netcdf x { dimensions: x = 1 ; y = 1 ; variables: int foo(y, x) ; string foo:coordinates = "x y" ; data: foo =
0 ;
}
Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.7.7 (default, Mar 23 2020, 22:36:06) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.9.12-200.fc33.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.1 xarray: 0.16.2 pandas: 1.2.0 numpy: 1.19.2 scipy: 1.5.2 netCDF4: 1.4.2 pydap: None h5netcdf: 0.8.1 h5py: 2.10.0 Nio: None zarr: None cftime: 1.3.0 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2021.01.0 distributed: 2021.01.0 matplotlib: 3.2.1 cartopy: 0.17.0 seaborn: None numbagg: None pint: None setuptools: 51.1.2.post20210112 pip: 20.3.3 conda: None pytest: 5.4.3 IPython: 7.19.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4822/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |