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 391721237,MDExOlB1bGxSZXF1ZXN0MjM5MTUxMzQ3,2615,"FIX Don't raise a deprecation warning for xarray.ufuncs.{angle,iscomplex}",630936,closed,0,,,2,2018-12-17T13:51:06Z,2018-12-20T18:10:20Z,2018-12-20T18:01:39Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2615,"Closes https://github.com/pydata/xarray/issues/2609 This removes PendingDeprecationWarnings for `xarray.ufuncs.{angle,iscomplex}` which appear to not be proper ufuncs and cannot be just used from numpy for now (as discussed in the parent issue). Also adds more generic tests that numpy ufuncs do preserve the DataArray dtype.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2615/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 391398977,MDU6SXNzdWUzOTEzOTg5Nzc=,2609,Cannot replace xr.ufuncs.angle with np.angle,630936,closed,0,,,2,2018-12-15T18:01:46Z,2018-12-20T18:01:38Z,2018-12-20T18:01:38Z,CONTRIBUTOR,,,,"Currently one gets a deprecation warning when using `xarray.ufuncs.angle` on a DataArray with xarray 0.11 and numpy 1.15, e.g. ``` PendingDeprecationWarning: xarray.ufuncs will be deprecated when xarray no longer supports versions of numpy older than v1.13. Instead, use numpy ufuncs directly. X_tr = xr.ufuncs.angle(X) ``` however, `np.angle` still casts the input to `ndarray`, apparently. #### Code Sample, a copy-pastable example if possible ```python >>> import xarray as xr >>> import numpy as np >>> X = xr.DataArray(np.ones(10)) >>> X array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]) Dimensions without coordinates: dim_0 >>> xr.ufuncs.angle(X) # expected output array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]) Dimensions without coordinates: dim_0 >>> np.angle(X) # actual output array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]) >>> np.__version__ '1.15.4' >>> xr.__version__ '0.11.0' >>> np.sin(X) # other ufuns work array([0.841471, 0.841471, 0.841471, 0.841471, 0.841471, 0.841471, 0.841471, 0.841471, 0.841471, 0.841471]) Dimensions without coordinates: dim_0 ``` #### Problem description I have not investigated yet why happens in numpy, but opening this issue to indicate that currently I can't really do much about this DeprecationWarning sort of silencing it (unless I'm missing something). #### Output of ``xr.show_versions()``
INSTALLED VERSIONS ------------------ commit: None python: 3.7.1.final.0 python-bits: 64 OS: Linux OS-release: 4.18.8-gentoo machine: x86_64 processor: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz byteorder: little LC_ALL: None LANG: en_GB.UTF-8 LOCALE: en_GB.UTF-8 xarray: 0.11.0 pandas: 0.23.4 numpy: 1.15.4 scipy: 1.1.0 netCDF4: None h5netcdf: 0.6.2 h5py: 2.8.0 Nio: None zarr: None cftime: None PseudonetCDF: None rasterio: None iris: None bottleneck: None cyordereddict: None dask: 1.0.0 distributed: None matplotlib: 3.0.2 cartopy: None seaborn: None setuptools: 40.6.2 pip: 18.1 conda: None pytest: 4.0.1 IPython: None sphinx: None
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2609/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue