From 3cf29b94ab2e994df86662492f952b4e0edb1c99 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 3 Jul 2025 12:56:00 -0500 Subject: [PATCH 1/2] Type div_ceil --- pytools/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 0bbcf44e..09e1eacd 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -1144,7 +1144,7 @@ def set_sum(set_iterable): return reduce(or_, set_iterable, set()) -def div_ceil(nr, dr): +def div_ceil(nr: int, dr: int): return -(-nr // dr) From 6346ff5583f24a5975f8b5e41569dc6e6380b6db Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 3 Jul 2025 12:56:06 -0500 Subject: [PATCH 2/2] Add ObjectArray.T --- pytools/obj_array.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytools/obj_array.py b/pytools/obj_array.py index 9dc188ff..75382a86 100644 --- a/pytools/obj_array.py +++ b/pytools/obj_array.py @@ -152,6 +152,9 @@ def __len__(self) -> int: ... @property def size(self) -> int: ... + @property + def T(self) -> Self: ... # noqa: N802 + @overload def __getitem__(self, x: ShapeT, /) -> T: ...