From e0010cde7a874ce07182328d346c8da04b45ab53 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 4 Dec 2025 10:48:25 -0600 Subject: [PATCH] ArrayContext.zeros: accept DTypeLike --- arraycontext/context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arraycontext/context.py b/arraycontext/context.py index a963e544..e0b2b907 100644 --- a/arraycontext/context.py +++ b/arraycontext/context.py @@ -135,6 +135,7 @@ if TYPE_CHECKING: import numpy as np + from numpy.typing import DTypeLike import loopy from pytools.tag import ToTagSetConvertible @@ -223,7 +224,7 @@ def __hash__(self) -> int: def zeros(self, shape: int | tuple[int, ...], - dtype: np.dtype[Any]) -> Array: + dtype: DTypeLike) -> Array: warn(f"{type(self).__name__}.zeros is deprecated and will stop " "working in 2025. Use actx.np.zeros instead.", DeprecationWarning, stacklevel=2)