Skip to content

Commit 3defd90

Browse files
committed
revert lazywhere hack
1 parent 11fbc2f commit 3defd90

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

scipy/_lib/_util.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ def _lazywhere(cond, arrays, f, fillvalue=None, f2=None):
127127
"""
128128
xp = array_namespace(cond, *arrays)
129129

130-
if is_dask(xp) or is_jax(xp):
131-
# TODO: verify for jax
132-
return xp.where(cond, f(arrays[0], arrays[1]), f2(arrays[0], arrays[1]) if not fillvalue else fillvalue)
133-
134130
if (f2 is fillvalue is None) or (f2 is not None and fillvalue is not None):
135131
raise ValueError("Exactly one of `fillvalue` or `f2` must be given.")
136132

scipy/_lib/tests/test__util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def test_array_api(self, xp, nan_policy):
360360
x = xp.asarray(x0)
361361
# Non array-api-compat dask.asarray doesn't copy correctly
362362
# so do this instead of xp_copy
363-
x_nan = xp.asarray(x.copy())
363+
x_nan = xp.asarray(x0.copy())
364364
x_nan[1, 2, 1] = np.nan
365365

366366
contains_nan, nan_policy_out = _contains_nan(x, nan_policy=nan_policy)

0 commit comments

Comments
 (0)