-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
apply_ufunc erroneously operating on an empty array when dask used #3168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The warning may have been fixed in the development version of dask by dask/dask#5103 The computing on empty arrays thing is due to the new |
I am not sure if this is related or not, but my dask array has a different shape before and after computing. After computing by converting to a numpy array, it looks like the time dimension (44) is still there, which is expected but I would also expect this to show in the xarray metadata.
|
Closed by #3660 |
Problem description
apply_ufunc
withdask='parallelized'
appears to be trying to act on an empty numpy array when the computation is specified, but before.compute()
is called. In other words, a ufunc which just prints the shape of its argument will print(0,0)
then print the correct shape once.compute()
is called.Minimum working example
Result
Expected result
Same thing without the
(0,0)
or the numpy warning.Output of
xr.show_versions()
(my xarray is up-to-date with master)
xarray: 0.12.3+23.g1d7bcbd
pandas: 0.24.2
numpy: 1.16.4
scipy: 1.3.0
netCDF4: 1.4.2
pydap: None
h5netcdf: None
h5py: 2.8.0
Nio: None
zarr: None
cftime: 1.0.3.4
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.2.1
dask: 2.1.0
distributed: 2.1.0
matplotlib: 3.1.0
cartopy: None
seaborn: 0.9.0
numbagg: None
setuptools: 40.6.2
pip: 18.1
conda: None
pytest: 4.0.0
IPython: 7.1.1
sphinx: 1.8.2
The text was updated successfully, but these errors were encountered: