Description
Problem description
dask 1.1.0 moved atop()
to blockwise()
and introduced a warning when atop()
is used.
Related
- upstream ticket and PR of dask change: Move dask/array/top.py code to dask/blockwise.py dask/dask#4348 Better name for atop? dask/dask#4035
- the warning in the dask documentation in an xarray example, probably not on purpose
- warnings have been already discussed in silence a couple of warnings in tests #2727, but not fixed there
- same issue in a different project: Update to fix deprecation warning from dask regarding atop pytroll/satpy#608
Code Sample
import numpy as np
import xarray as xr
xr.DataArray(np.ones(1000))
d = xr.DataArray(np.ones(1000))
d.to_netcdf('/tmp/ones.nc')
d = xr.open_dataarray('/tmp/ones.nc', chunks=10)
xr.apply_ufunc(lambda x: 42 * x, d, dask='parallelized', output_dtypes=[np.float64])
This outputs the warning:
...lib/python3.7/site-packages/dask/array/blockwise.py:204: UserWarning: The da.atop function has moved to da.blockwise
warnings.warn("The da.atop function has moved to da.blockwise")
Expected Output
No warning. As user of a recent version of dask and xarray, there shouldn't be any warnings if everything is done right. The warning should be tackled inside xarray somehow.
Solution
Not sure, can xarray break compatibility with dask <1.1.0 with some future version? Otherwise I guess there needs to be some legacy code in xarray which calls the right function.
Output of xr.show_versions()
xarray: 0.12.1
pandas: 0.24.2
numpy: 1.16.3
scipy: 1.2.1
netCDF4: 1.4.2
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.0.3.4
nc_time_axis: None
PseudonetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 1.2.0
distributed: 1.27.0
matplotlib: 3.0.3
cartopy: None
seaborn: 0.9.0
setuptools: 41.0.0
pip: 19.1
conda: None
pytest: 4.4.1
IPython: 7.5.0
sphinx: None