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 717217552,MDU6SXNzdWU3MTcyMTc1NTI=,4495,`combine_by_coords` fails giving StopIteration error,20053498,closed,0,,,5,2020-10-08T10:24:42Z,2020-10-13T07:03:24Z,2020-10-13T07:03:24Z,NONE,,,,"The dataset is WFDEI historical tasmax downloaded from ESGF. (isimip2a.input.clim_atm_obs.WFDEI.historical.tasmax.daily.v20190812|esg.pik-potsdam.de) Can provide a wget script if necessary. The code is as follows: ``` import xarray as xr from pathlib import Path directory = Path(""/gws/nopw/j04/bas_climate/users/champs/WFDEI"") input_paths = list(directory.glob('tasmax_*nc')) xr.open_mfdataset(input_paths, combine='by_coords', use_cftime=True) ``` The error message ``` --------------------------------------------------------------------------- StopIteration Traceback (most recent call last) in 4 directory = Path(""/gws/nopw/j04/bas_climate/users/champs/WFDEI"") 5 input_paths = list(directory.glob('tasmax_*nc')) ----> 6 xr.open_mfdataset(input_paths, combine='by_coords', use_cftime=True) ~/miniconda3/envs/ucd/lib/python3.7/site-packages/xarray/backends/api.py in open_mfdataset(paths, chunks, concat_dim, compat, preprocess, engine, lock, data_vars, coords, combine, autoclose, parallel, join, attrs_file, **kwargs) 957 # previously 958 combined = combine_by_coords( --> 959 datasets, compat=compat, data_vars=data_vars, coords=coords, join=join 960 ) 961 else: ~/miniconda3/envs/ucd/lib/python3.7/site-packages/xarray/core/combine.py in combine_by_coords(datasets, compat, data_vars, coords, fill_value, join) 700 compat=compat, 701 fill_value=fill_value, --> 702 join=join, 703 ) 704 ~/miniconda3/envs/ucd/lib/python3.7/site-packages/xarray/core/combine.py in _combine_nd(combined_ids, concat_dims, data_vars, coords, compat, fill_value, join) 180 """""" 181 --> 182 example_tile_id = next(iter(combined_ids.keys())) 183 184 n_dims = len(example_tile_id) StopIteration: ``` Each of the files can be opened individually with `xr.open_dataset`. **Environment**: 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: 3.10.0-1127.19.1.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.1 xarray: 0.15.1 pandas: 1.0.3 numpy: 1.18.1 scipy: 1.3.2 netCDF4: 1.4.2 pydap: None h5netcdf: 0.8.0 h5py: 2.10.0 Nio: None zarr: None cftime: 1.1.2 nc_time_axis: 1.2.0 PseudoNetCDF: None rasterio: 1.0.21 cfgrib: None iris: 2.4.0 bottleneck: None dask: 2.11.0 distributed: 2.11.0 matplotlib: 3.1.3 cartopy: 0.17.0 seaborn: None numbagg: None setuptools: 46.2.0.post20200511 pip: 20.0.2 conda: None pytest: None IPython: 7.13.0 sphinx: None ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4495/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue