home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 497823072

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
497823072 MDU6SXNzdWU0OTc4MjMwNzI= 3339 Version 0.13 broke my ufunc 1872600 closed 0     5 2019-09-24T17:25:09Z 2019-09-24T20:32:40Z 2019-09-24T19:56:17Z NONE      

This simple xarray ufunc to calculate wind speed worked under xarray=0.12.3: python import xarray as xr url = 'http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/HRRR/CONUS_2p5km/Best' ds = xr.open_dataset(url, chunks={'time1':1}) windspeed = xr.ufuncs.sqrt(ds['u-component_of_wind_height_above_ground']**2 + ds['v-component_of_wind_height_above_ground']**2) but with xarray=0.13.0, merge_variables fails and dumps this traceback:

```python-traceback

ValueError Traceback (most recent call last) <ipython-input-4-2ac66965ccfc> in <module> ----> 1 windspeed = xr.ufuncs.sqrt(ds['u-component_of_wind_height_above_ground']2 + ds['v-component_of_wind_height_above_ground']2)

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/dataarray.py in func(self, other) 2495 else f(other_variable, self.variable) 2496 ) -> 2497 coords = self.coords._merge_raw(other_coords) 2498 name = self._result_name(other) 2499

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/coordinates.py in _merge_raw(self, other) 128 else: 129 # don't align because we already called xarray.align --> 130 variables = expand_and_merge_variables([self.variables, other.variables]) 131 return variables 132

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/merge.py in expand_and_merge_variables(objs, priority_arg) 380 expanded = expand_variable_dicts(objs) 381 priority_vars = _get_priority_vars(objs, priority_arg) --> 382 variables = merge_variables(expanded, priority_vars) 383 return variables 384

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/merge.py in merge_variables(list_of_variables_dicts, priority_vars, compat) 202 else: 203 try: --> 204 merged[name] = unique_variable(name, var_list, compat) 205 except MergeError: 206 if compat != "minimal":

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/merge.py in unique_variable(name, variables, compat, equals) 116 out = out.compute() 117 for var in variables[1:]: --> 118 equals = getattr(out, compat)(var) 119 if not equals: 120 break

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/variable.py in broadcast_equals(self, other, equiv) 1574 except (ValueError, AttributeError): 1575 return False -> 1576 return self.equals(other, equiv=equiv) 1577 1578 def identical(self, other):

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/variable.py in equals(self, other, equiv) 1558 try: 1559 return self.dims == other.dims and ( -> 1560 self._data is other._data or equiv(self.data, other.data) 1561 ) 1562 except (TypeError, AttributeError):

/srv/conda/envs/notebook/lib/python3.7/site-packages/xarray/core/duck_array_ops.py in array_equiv(arr1, arr2) 200 with warnings.catch_warnings(): 201 warnings.filterwarnings("ignore", "In the future, 'NAT == x'") --> 202 flag_array = (arr1 == arr2) | (isnull(arr1) & isnull(arr2)) 203 return bool(flag_array.all()) 204

/srv/conda/envs/notebook/lib/python3.7/site-packages/dask/array/core.py in eq(self, other) 1740 1741 def eq(self, other): -> 1742 return elemwise(operator.eq, self, other) 1743 1744 def gt(self, other):

/srv/conda/envs/notebook/lib/python3.7/site-packages/dask/array/core.py in elemwise(op, args, kwargs) 3765 for a in args 3766 ), -> 3767 *blockwise_kwargs 3768 ) 3769

/srv/conda/envs/notebook/lib/python3.7/site-packages/dask/array/blockwise.py in blockwise(func, out_ind, name, token, dtype, adjust_chunks, new_axes, align_arrays, concatenate, meta, args, kwargs) 143 144 if align_arrays: --> 145 chunkss, arrays = unify_chunks(args) 146 else: 147 arginds = [(a, i) for (a, i) in toolz.partition(2, args) if i is not None]

/srv/conda/envs/notebook/lib/python3.7/site-packages/dask/array/core.py in unify_chunks(args, *kwargs) 3034 3035 arginds = [ -> 3036 (asanyarray(a) if ind is not None else a, ind) for a, ind in partition(2, args) 3037 ] # [x, ij, y, jk] 3038 args = list(concat(arginds)) # [(x, ij), (y, jk)]

/srv/conda/envs/notebook/lib/python3.7/site-packages/dask/array/core.py in <listcomp>(.0) 3034 3035 arginds = [ -> 3036 (asanyarray(a) if ind is not None else a, ind) for a, ind in partition(2, args) 3037 ] # [x, ij, y, jk] 3038 args = list(concat(arginds)) # [(x, ij), (y, jk)]

/srv/conda/envs/notebook/lib/python3.7/site-packages/dask/array/core.py in asanyarray(a) 3609 elif hasattr(a, "to_dask_array"): 3610 return a.to_dask_array() -> 3611 elif hasattr(a, "data") and type(a).module.startswith("xarray."): 3612 return asanyarray(a.data) 3613 elif isinstance(a, (list, tuple)) and any(isinstance(i, Array) for i in a):

ValueError: cannot include dtype 'M' in a buffer ```

Is this a bug or a feature that I should be handling differently in my code?

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.14.138-114.102.amzn2.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_US.UTF-8 LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.6.2 xarray: 0.13.0 pandas: 0.24.2 numpy: 1.17.2 scipy: 1.3.1 netCDF4: 1.5.1.2 pydap: installed h5netcdf: 0.7.4 h5py: 2.10.0 Nio: None zarr: 2.3.2 cftime: 1.0.3.4 nc_time_axis: None PseudoNetCDF: None rasterio: 1.0.28 cfgrib: None iris: 2.2.0 bottleneck: None dask: 2.2.0 distributed: 2.2.0 matplotlib: 3.1.1 cartopy: 0.17.0 seaborn: None numbagg: None setuptools: 41.2.0 pip: 19.2.3 conda: None pytest: None IPython: 7.8.0 sphinx: None ​
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3339/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.74ms · About: xarray-datasette