-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
map_blocks output inference problems #3575
Comments
p.s. In this case the default assumption, that the output would be the same shape and dtype as the input, would have been fine. |
I've been sticking this at the top when necessary: if sum(ds.shape) == 0:
return ds |
Right that’s what I did too. But it’s a hack!
…Sent from my iPhone
On Nov 26, 2019, at 1:25 PM, Deepak Cherian ***@***.***> wrote:
p.s. In this case the default assumption, that the output would be the same shape and dtype as the input, would have been fine.
I've been sticking this at the top when necessary:
if sum(ds.shape) == 0:
return ds
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
+1, for the Dataset case, this would require some sort of dtype/shape schema though. |
This is why I didn't do it for the first pass |
With #3816, this becomes
@rabernat How does this look to you? |
I am excited about using
map_blocks
to overcome a long-standing challenge related to calculating climatologies / anomalies with dask arrays. However, I hit what feels like a bug. I don't love how the newmap_blocks
function does this:The problem is that many functions will simply error on size 0 data. As in the example below
MCVE Code Sample
Raises
Problem Description
We should try to imitate what dask does in
map_blocks
: https://docs.dask.org/en/latest/array-api.html#dask.array.map_blocksSpecifically:
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+
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.14.0
pandas: 0.25.3
numpy: 1.17.3
scipy: 1.3.2
netCDF4: 1.5.1.2
pydap: installed
h5netcdf: 0.7.4
h5py: 2.10.0
Nio: None
zarr: 2.3.2
cftime: 1.0.4.2
nc_time_axis: 1.2.0
PseudoNetCDF: None
rasterio: 1.0.25
cfgrib: None
iris: 2.2.0
bottleneck: 1.3.0
dask: 2.7.0
distributed: 2.7.0
matplotlib: 3.1.2
cartopy: 0.17.0
seaborn: 0.9.0
numbagg: None
setuptools: 41.6.0.post20191101
pip: 19.3.1
conda: None
pytest: 5.3.1
IPython: 7.9.0
sphinx: None
The text was updated successfully, but these errors were encountered: