html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/662#issuecomment-157572531,https://api.github.com/repos/pydata/xarray/issues/662,157572531,MDEyOklzc3VlQ29tbWVudDE1NzU3MjUzMQ==,7799184,2015-11-18T02:00:07Z,2015-11-18T02:00:07Z,CONTRIBUTOR,"Awesome, works here too with netCDF4==1.2.1 Thanks! ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,117478779 https://github.com/pydata/xarray/issues/662#issuecomment-157570185,https://api.github.com/repos/pydata/xarray/issues/662,157570185,MDEyOklzc3VlQ29tbWVudDE1NzU3MDE4NQ==,7799184,2015-11-18T01:43:01Z,2015-11-18T01:43:01Z,CONTRIBUTOR,"Hum... Ok I will try that in another machine too.. The versions are: pandas==0.17.0 netCDF4==1.1.1 scipy==0.15.1 numpy==1.10.1 xray==0.6.1-15-g5109f4f ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,117478779 https://github.com/pydata/xarray/issues/662#issuecomment-157567446,https://api.github.com/repos/pydata/xarray/issues/662,157567446,MDEyOklzc3VlQ29tbWVudDE1NzU2NzQ0Ng==,7799184,2015-11-18T01:26:01Z,2015-11-18T01:26:01Z,CONTRIBUTOR,"@shoyer I'm sending you by email (was not able to attach here) a stripped version of one of the files I was using. The code below should reproduce the issue: ``` import xray dset = xray.open_dataset('hycom_example.nc', decode_times=False) ncvar = 'water_u' dset_sliced = xray.Dataset() slice_dict = {u'lat': [-30], u'lon': [0]} dset_sliced[ncvar] = dset[ncvar].sel(method='nearest', **slice_dict) dset_sliced.to_netcdf() ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,117478779 https://github.com/pydata/xarray/issues/662#issuecomment-157564974,https://api.github.com/repos/pydata/xarray/issues/662,157564974,MDEyOklzc3VlQ29tbWVudDE1NzU2NDk3NA==,7799184,2015-11-18T01:09:00Z,2015-11-18T01:09:00Z,CONTRIBUTOR,"@maximilianr I have managed to reproduce this with a different file with different number of dimensions (time, latitude, longitude). So I believe the below example should give same problem if you run on some other file and change the variable / dimension names accordingly: ``` ncvar = 'hs' dset_sliced1 = xray.Dataset() dset_sliced2 = xray.Dataset() dset = xray.open_dataset(filename, decode_times=False) slice_dict1 = {u'latitude': [-30], u'longitude': [0], u'time': [2.83996800e+08, 2.84007600e+08]} dset_sliced1[ncvar] = dset[ncvar].sel(method='nearest', **slice_dict1) slice_dict2 = {u'latitude': [-30], u'longitude': [0], u'time': [2.84018400e+08, 2.84029200e+08]} dset_sliced2[ncvar] = dset[ncvar].sel(method='nearest', **slice_dict2) dset_sliced1.to_netcdf('test.nc') # This fails xray.concat([dset_sliced1, dset_sliced2], dim='time') # This also fails, same error Traceback: ----> 1 xray.concat([dset_sliced1, dset_sliced2], dim='time') # This also fails /source/xray/xray/core/combine.pyc in concat(objs, dim, data_vars, coords, compat, positions, indexers, mode, concat_over) 113 raise TypeError('can only concatenate xray Dataset and DataArray ' 114 'objects') --> 115 return f(objs, dim, data_vars, coords, compat, positions) 116 117 /source/xray/xray/core/combine.pyc in _dataset_concat(datasets, dim, data_vars, coords, compat, positions) 265 for k in concat_over: 266 vars = ensure_common_dims([ds.variables[k] for ds in datasets]) --> 267 combined = Variable.concat(vars, dim, positions) 268 insert_result_variable(k, combined) 269 /source/xray/xray/core/variable.pyc in concat(cls, variables, dim, positions, shortcut) 711 utils.remove_incompatible_items(attrs, var.attrs) 712 --> 713 return cls(dims, data, attrs) 714 715 def _data_equals(self, other): /source/xray/xray/core/variable.pyc in __init__(self, dims, data, attrs, encoding, fastpath) 194 """""" 195 self._data = _as_compatible_data(data, fastpath=fastpath) --> 196 self._dims = self._parse_dimensions(dims) 197 self._attrs = None 198 self._encoding = None /source/xray/xray/core/variable.pyc in _parse_dimensions(self, dims) 302 raise ValueError('dimensions %s must have the same length as the ' 303 'number of data dimensions, ndim=%s' --> 304 % (dims, self.ndim)) 305 return dims 306 ValueError: dimensions (u'time', u'latitude', u'longitude') must have the same length as the number of data dimensions, ndim=2 ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,117478779 https://github.com/pydata/xarray/issues/662#issuecomment-157559691,https://api.github.com/repos/pydata/xarray/issues/662,157559691,MDEyOklzc3VlQ29tbWVudDE1NzU1OTY5MQ==,7799184,2015-11-18T00:43:32Z,2015-11-18T00:43:32Z,CONTRIBUTOR,"I was concatenating them as: ``` dset_concat = xray.concat([ds1, ds2], dim='time') ``` Trying to dump any of them as netcdf: ``` ds1.to_netcdf('test.nc') ``` would also yield the same problem ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,117478779