From fcddde32eb53ecd9339470cf251e67dd905b9106 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Thu, 27 Mar 2025 12:39:24 +0000 Subject: [PATCH] MAINT: add Dask note to `lazy_apply` --- src/array_api_extra/_lib/_lazy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/array_api_extra/_lib/_lazy.py b/src/array_api_extra/_lib/_lazy.py index 7b45eff9..d13d08f8 100644 --- a/src/array_api_extra/_lib/_lazy.py +++ b/src/array_api_extra/_lib/_lazy.py @@ -144,7 +144,12 @@ def lazy_apply( # type: ignore[valid-type] # numpydoc ignore=GL07,SA04 Dask This allows applying eager functions to Dask arrays. - The Dask graph won't be computed. + The Dask graph won't be computed until the user calls ``compute()`` or + ``persist()`` down the line. + + The function name will be prominently visible on the user-facing Dask + dashboard and on Prometheus metrics, so it is recommended for it to be + meaningful. `lazy_apply` doesn't know if `func` reduces along any axes; also, shape changes are non-trivial in chunked Dask arrays. For these reasons, all inputs