issue_comments: 260028968
This data as json
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/1106#issuecomment-260028968 | https://api.github.com/repos/pydata/xarray/issues/1106 | 260028968 | MDEyOklzc3VlQ29tbWVudDI2MDAyODk2OA== | 1217238 | 2016-11-11T18:57:17Z | 2016-11-11T18:57:17Z | MEMBER | I get the same error attempting to same RASM on xarray v0.8.2. On xarray master, I get a different error, related to encoding datetimes: ``` In [1]: import xarray as xr In [2]: ds = xr.tutorial.load_dataset('rasm') /Users/shoyer/dev/xarray/xarray/conventions.py:386: RuntimeWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using dummy netCDF4.datetime objects instead, reason: dates out of range result = decode_cf_datetime(example_value, units, calendar) In [3]: ds.to_netcdf('rasm.nc', format='NETCDF3_CLASSIC', engine='scipy')TypeError Traceback (most recent call last) <ipython-input-3-f834a013f387> in <module>() ----> 1 ds.to_netcdf('rasm.nc', format='NETCDF3_CLASSIC', engine='scipy') /Users/shoyer/dev/xarray/xarray/core/dataset.py in to_netcdf(self, path, mode, format, group, engine, encoding) 801 from ..backends.api import to_netcdf 802 return to_netcdf(self, path, mode, format=format, group=group, --> 803 engine=engine, encoding=encoding) 804 805 def unicode(self): /Users/shoyer/dev/xarray/xarray/backends/api.py in to_netcdf(dataset, path, mode, format, group, engine, writer, encoding) 513 store = store_cls(path, mode, format, group, writer) 514 try: --> 515 dataset.dump_to_store(store, sync=sync, encoding=encoding) 516 if isinstance(path, BytesIO): 517 return path.getvalue() /Users/shoyer/dev/xarray/xarray/core/dataset.py in dump_to_store(self, store, encoder, sync, encoding) 747 variables, attrs = encoder(variables, attrs) 748 --> 749 store.store(variables, attrs, check_encoding) 750 if sync: 751 store.sync() /Users/shoyer/dev/xarray/xarray/backends/common.py in store(self, variables, attributes, check_encoding_set) 230 # All NetCDF files get CF encoded by default, without this attempting 231 # to write times, for example, would fail. --> 232 cf_variables, cf_attrs = cf_encoder(variables, attributes) 233 AbstractWritableDataStore.store(self, cf_variables, cf_attrs, 234 check_encoding_set) /Users/shoyer/dev/xarray/xarray/conventions.py in cf_encoder(variables, attributes) 1067 """ 1068 new_vars = OrderedDict((k, encode_cf_variable(v, name=k)) -> 1069 for k, v in iteritems(variables)) 1070 return new_vars, attributes /Users/shoyer/dev/xarray/xarray/conventions.py in <genexpr>(.0) 1067 """ 1068 new_vars = OrderedDict((k, encode_cf_variable(v, name=k)) -> 1069 for k, v in iteritems(variables)) 1070 return new_vars, attributes /Users/shoyer/dev/xarray/xarray/conventions.py in encode_cf_variable(var, needs_copy, name) 721 var, needs_copy = maybe_encode_offset_and_scale(var, needs_copy) 722 var, needs_copy = maybe_encode_fill_value(var, needs_copy) --> 723 var = maybe_encode_dtype(var, name) 724 var = maybe_encode_bools(var) 725 var = ensure_dtype_not_object(var) /Users/shoyer/dev/xarray/xarray/conventions.py in maybe_encode_dtype(var, name) 634 data = string_to_char(np.asarray(data, 'S')) 635 dims = dims + ('string%s' % data.shape[-1],) --> 636 data = data.astype(dtype=dtype) 637 var = Variable(dims, data, attrs, encoding) 638 return var TypeError: float() argument must be a string or a number, not 'datetime.datetime' ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
188565022 |