Skip to content
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

Replace parallelized with allowed #221

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Internal Changes
(:issue:`160`, :pr:`230`) `Ray Bell`_
- Pin ``numba`` to ``>=0.52`` to fix CI (:issue:`233`, :pr:`234`) `Ray Bell`_
- Refactor ``asv`` benchmarks. (:pr:`231`) `Aaron Spring`_

- Slight optimization using dask="allowed" instead of dask="parallelized"
(:issue:`207`, :pr:`220`). `Andrew Huang`_

xskillscore v0.0.18 (2020-09-23)
--------------------------------
Expand Down
32 changes: 17 additions & 15 deletions xskillscore/core/deterministic.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"r2",
]

UFUNC_DASK_KW = "allowed"


def _determine_input_core_dims(dim, weights):
"""
Expand Down Expand Up @@ -137,7 +139,7 @@ def pearson_r(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -227,7 +229,7 @@ def r2(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -289,7 +291,7 @@ def pearson_r_p_value(a, b, dim=None, weights=None, skipna=False, keep_attrs=Fal
weights,
input_core_dims=input_core_dims,
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -379,7 +381,7 @@ def effective_sample_size(a, b, dim="time", skipna=False, keep_attrs=False):
b,
input_core_dims=[[new_dim], [new_dim]],
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -481,7 +483,7 @@ def pearson_r_eff_p_value(a, b, dim=None, skipna=False, keep_attrs=False):
b,
input_core_dims=[[new_dim], [new_dim]],
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -548,7 +550,7 @@ def spearman_r(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -610,7 +612,7 @@ def spearman_r_p_value(a, b, dim=None, weights=None, skipna=False, keep_attrs=Fa
weights,
input_core_dims=input_core_dims,
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -714,7 +716,7 @@ def spearman_r_eff_p_value(a, b, dim=None, skipna=False, keep_attrs=False):
b,
input_core_dims=[[new_dim], [new_dim]],
kwargs={"axis": -1, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -773,7 +775,7 @@ def me(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": axis, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -840,7 +842,7 @@ def rmse(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": axis, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -907,7 +909,7 @@ def mse(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": axis, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -974,7 +976,7 @@ def mae(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": axis, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -1034,7 +1036,7 @@ def median_absolute_error(a, b, dim=None, skipna=False, keep_attrs=False):
b,
input_core_dims=[dim, dim],
kwargs={"axis": axis, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -1110,7 +1112,7 @@ def mape(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": axis, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)
Expand Down Expand Up @@ -1180,7 +1182,7 @@ def smape(a, b, dim=None, weights=None, skipna=False, keep_attrs=False):
weights,
input_core_dims=input_core_dims,
kwargs={"axis": axis, "skipna": skipna},
dask="parallelized",
dask=UFUNC_DASK_KW,
output_dtypes=[float],
keep_attrs=keep_attrs,
)