@@ -33,7 +33,7 @@ class P: # pylint: disable=missing-class-docstring
33
33
34
34
35
35
@overload
36
- def apply_lazy ( # type: ignore[valid-type]
36
+ def lazy_apply ( # type: ignore[valid-type]
37
37
func : Callable [P , ArrayLike ],
38
38
* args : Array ,
39
39
shape : tuple [int | None , ...] | None = None ,
@@ -45,7 +45,7 @@ def apply_lazy( # type: ignore[valid-type]
45
45
46
46
47
47
@overload
48
- def apply_lazy ( # type: ignore[valid-type]
48
+ def lazy_apply ( # type: ignore[valid-type]
49
49
func : Callable [P , Sequence [ArrayLike ]],
50
50
* args : Array ,
51
51
shape : Sequence [tuple [int | None , ...]],
@@ -56,7 +56,7 @@ def apply_lazy( # type: ignore[valid-type]
56
56
) -> tuple [Array , ...]: ... # numpydoc ignore=GL08
57
57
58
58
59
- def apply_lazy ( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04
59
+ def lazy_apply ( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04
60
60
func : Callable [P , Array | Sequence [ArrayLike ]],
61
61
* args : Array ,
62
62
shape : tuple [int | None , ...] | Sequence [tuple [int | None , ...]] | None = None ,
@@ -142,7 +142,7 @@ def apply_lazy( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04
142
142
This allows applying eager functions to dask arrays.
143
143
The dask graph won't be computed.
144
144
145
- `apply_lazy ` doesn't know if `func` reduces along any axes; also, shape
145
+ `lazy_apply ` doesn't know if `func` reduces along any axes; also, shape
146
146
changes are non-trivial in chunked Dask arrays. For these reasons, all inputs
147
147
will be rechunked into a single chunk.
148
148
@@ -156,7 +156,7 @@ def apply_lazy( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04
156
156
If you want to distribute the calculation across multiple workers, you
157
157
should use :func:`dask.array.map_blocks`, :func:`dask.array.map_overlap`,
158
158
:func:`dask.array.blockwise`, or a native Dask wrapper instead of
159
- `apply_lazy `.
159
+ `lazy_apply `.
160
160
161
161
Dask wrapping around other backends
162
162
If `as_numpy=False`, `func` will receive in input eager arrays of the meta
@@ -229,7 +229,7 @@ def apply_lazy( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04
229
229
meta_xp = array_namespace (* metas )
230
230
231
231
wrapped = dask .delayed (
232
- _apply_lazy_wrapper (func , as_numpy , multi_output , meta_xp ),
232
+ _lazy_apply_wrapper (func , as_numpy , multi_output , meta_xp ),
233
233
pure = True ,
234
234
)
235
235
# This finalizes each arg, which is the same as arg.rechunk(-1).
@@ -256,7 +256,7 @@ def apply_lazy( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04
256
256
257
257
import jax # type: ignore[import-not-found] # pylint: disable=import-outside-toplevel,import-error # pyright: ignore[reportMissingImports]
258
258
259
- wrapped = _apply_lazy_wrapper (func , as_numpy , multi_output , xp )
259
+ wrapped = _lazy_apply_wrapper (func , as_numpy , multi_output , xp )
260
260
261
261
if any (s is None for shape in shapes for s in shape ):
262
262
# Unknown output shape. Won't work with jax.jit, but it
@@ -280,20 +280,20 @@ def apply_lazy( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04
280
280
281
281
else :
282
282
# Eager backends
283
- wrapped = _apply_lazy_wrapper (func , as_numpy , multi_output , xp )
283
+ wrapped = _lazy_apply_wrapper (func , as_numpy , multi_output , xp )
284
284
out = wrapped (* args , ** kwargs )
285
285
286
286
return out if multi_output else out [0 ]
287
287
288
288
289
- def _apply_lazy_wrapper ( # type: ignore[no-any-explicit] # numpydoc ignore=PR01,RT01
289
+ def _lazy_apply_wrapper ( # type: ignore[no-any-explicit] # numpydoc ignore=PR01,RT01
290
290
func : Callable [..., ArrayLike | Sequence [ArrayLike ]],
291
291
as_numpy : bool ,
292
292
multi_output : bool ,
293
293
xp : ModuleType ,
294
294
) -> Callable [..., tuple [Array , ...]]:
295
295
"""
296
- Helper of `apply_lazy `.
296
+ Helper of `lazy_apply `.
297
297
298
298
Given a function that accepts one or more arrays as positional arguments and returns
299
299
a single array-like or a sequence of array-likes, return a function that accepts the
0 commit comments