xgcm / xhistogram

Fast, flexible, label-aware histograms for numpy and xarray
https://xhistogram.readthedocs.io
MIT License
89 stars 19 forks source link

make `dask.array` dependency not `dask` to speedup pip install #70

Closed aaronspring closed 2 years ago

aaronspring commented 2 years ago

When installing xhistogram via pip many packages (bokeh etc) are installed due to the dask dependency. https://github.com/xgcm/xhistogram/network/dependencies

However, we actually only/mostly use dask.array. Could we make dask.array the dependency, not dask? I am unsure whether this makes the difference I want to see

dask.is_dask_collection is used in https://github.com/xgcm/xhistogram/blob/5c12e178cfeefa1c36c2b9ea45fe2101f35c9bd2/xhistogram/core.py#L339, but this could be replaced as in https://github.com/xgcm/xhistogram/blob/5c12e178cfeefa1c36c2b9ea45fe2101f35c9bd2/xhistogram/core.py#L34 by isinstance(a, dsa.core.Array)

x-ref to https://github.com/xarray-contrib/xskillscore/issues/359

rabernat commented 2 years ago

Thanks for the suggestion Aaron! PR for these changes would be most welcome.