From 85d5418812fcae5c6a7a5845d04c2b02e778a856 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 15 Jul 2025 18:09:51 -0500 Subject: [PATCH 1/6] Add {set,fset}_union from loopy, deprecate set_sum --- pytools/__init__.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 3e0d1819..d7de42b3 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -56,8 +56,9 @@ TypeVar, cast, ) +from warnings import warn -from typing_extensions import Self, dataclass_transform, override +from typing_extensions import Self, dataclass_transform, deprecated, override from pytools.version import VERSION_TEXT @@ -111,6 +112,12 @@ .. autofunction:: argmin .. autofunction:: argmax +Reductions +---------- +.. autofunction:: product +.. autofunction:: set_union +.. autofunction:: fset_union + Cartesian products ------------------ .. autofunction:: cartesian_product @@ -1139,7 +1146,25 @@ def reverse_dictionary(the_dict: Mapping[K, V]) -> dict[V, K]: return result +def set_union(iterable: Iterable[Iterable[T]]): + """ + .. versionadded:: 2025.2.2 + """ + return cast("set[T]", set()).union(*iterable) + + +def fset_union(iterable: Iterable[Iterable[T]]): + """ + .. versionadded:: 2025.2.2 + """ + return cast("frozenset[T]", frozenset()).union(*iterable) + + +@deprecated("use set_union/fset_union instead") def set_sum(set_iterable): + warn("set_sum is deprecated, " + "use set_union instead. " + "This will stop working in 2027.", DeprecationWarning, stacklevel=2) from operator import or_ return reduce(or_, set_iterable, set()) From cc0ffa09c155b882f075286da2f8ca7ab96cc6ea Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 15 Jul 2025 18:10:14 -0500 Subject: [PATCH 2/6] ObjectArray arith: allow float --- pytools/obj_array.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pytools/obj_array.py b/pytools/obj_array.py index 75382a86..dfa43e2a 100644 --- a/pytools/obj_array.py +++ b/pytools/obj_array.py @@ -194,55 +194,55 @@ def __add__(self, other: Self, /) -> Self: ... @overload def __add__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __add__(self, other: int, /) -> Self: ... + def __add__(self, other: float, /) -> Self: ... @overload def __radd__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __radd__(self, other: int, /) -> Self: ... + def __radd__(self, other: float, /) -> Self: ... @overload def __sub__(self, other: Self, /) -> Self: ... @overload def __sub__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __sub__(self, other: int, /) -> Self: ... + def __sub__(self, other: float, /) -> Self: ... @overload def __rsub__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __rsub__(self, other: int, /) -> Self: ... + def __rsub__(self, other: float, /) -> Self: ... @overload def __mul__(self, other: Self, /) -> Self: ... @overload def __mul__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __mul__(self, other: int, /) -> Self: ... + def __mul__(self, other: float, /) -> Self: ... @overload def __rmul__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __rmul__(self, other: int, /) -> Self: ... + def __rmul__(self, other: float, /) -> Self: ... @overload def __truediv__(self, other: Self, /) -> Self: ... @overload def __truediv__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __truediv__(self, other: int, /) -> Self: ... + def __truediv__(self, other: float, /) -> Self: ... @overload def __rtruediv__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __rtruediv__(self, other: int, /) -> Self: ... + def __rtruediv__(self, other: float, /) -> Self: ... @overload def __pow__(self, other: Self, /) -> Self: ... @overload def __pow__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __pow__(self, other: int, /) -> Self: ... + def __pow__(self, other: float, /) -> Self: ... @overload def __rpow__(self, other: T, /) -> Self: ... # pyright: ignore[reportGeneralTypeIssues] @overload - def __rpow__(self, other: int, /) -> Self: ... + def __rpow__(self, other: float, /) -> Self: ... @overload def __matmul__( From 4a22d87372a90218141fc34d57b70339b09c94b5 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 15 Jul 2025 18:11:20 -0500 Subject: [PATCH 3/6] obj_array: add stack, concatenate, trace --- pytools/obj_array.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/pytools/obj_array.py b/pytools/obj_array.py index dfa43e2a..56c39054 100644 --- a/pytools/obj_array.py +++ b/pytools/obj_array.py @@ -21,6 +21,9 @@ .. autofunction:: to_numpy .. autofunction:: make_obj_array .. autofunction:: flat_obj_array +.. autofunction:: stack +.. autofunction:: concatenate +.. autofunction:: trace Mapping ------- @@ -352,6 +355,46 @@ def make_obj_array(res_list: Sequence[T]) -> ObjectArray1D[T]: def obj_array_to_hashable(ary: ObjectArray[ShapeT, T] | Hashable, /) -> Hashable: + + +def stack( + arrays: Sequence[ObjectArray[ShapeT, T]], + /, *, axis: Literal[0] = 0, + ) -> ObjectArray[tuple[int, Unpack[ShapeT]], T]: + """ + .. versionadded:: 2025.2.2 + """ + if axis != 0: + raise NotImplementedError("axis != 0") + + import numpy as np + return cast("ObjectArray[tuple[int, Unpack[ShapeT]], T]", cast("object", + np.stack(cast("Sequence[NDArray[Any]]", arrays)))) + + +def concatenate( + arrays: Sequence[ObjectArray[tuple[int, Unpack[ShapeT]], T]], + /, *, axis: Literal[0] = 0, + ) -> ObjectArray[tuple[int, Unpack[ShapeT]], T]: + """ + .. versionadded:: 2025.2.2 + """ + if axis != 0: + raise NotImplementedError("axis != 0") + + import numpy as np + return cast("ObjectArray[tuple[int, Unpack[ShapeT]], T]", cast("object", + np.concatenate(cast("Sequence[NDArray[Any]]", arrays)))) + + +def trace( + array: ObjectArray2D[T], /, + ) -> T: + """ + .. versionadded:: 2025.2.2 + """ + import numpy as np + return cast("T", np.trace(cast("NDArray[Any]", cast("object", array)))) if isinstance(ary, ObjectArray): ary = cast("ObjectArray[ShapeT, T]", ary) return tuple(ary.flat.tolist()) From c055b05374b4f71e928e0a441cb35520c9a1a3be Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 15 Jul 2025 18:11:56 -0500 Subject: [PATCH 4/6] obj_array: deprecate identifiers containing 'obj_array' --- pytools/obj_array.py | 133 +++++++++++++++++++++++++++-------- pytools/test/test_pytools.py | 22 +++--- 2 files changed, 113 insertions(+), 42 deletions(-) diff --git a/pytools/obj_array.py b/pytools/obj_array.py index 56c39054..d50c1a4e 100644 --- a/pytools/obj_array.py +++ b/pytools/obj_array.py @@ -19,8 +19,8 @@ .. autofunction:: from_numpy .. autofunction:: to_numpy -.. autofunction:: make_obj_array -.. autofunction:: flat_obj_array +.. autofunction:: new_1d +.. autofunction:: flat .. autofunction:: stack .. autofunction:: concatenate .. autofunction:: trace @@ -28,8 +28,8 @@ Mapping ------- -.. autofunction:: obj_array_vectorize -.. autofunction:: obj_array_vectorize_n_args +.. autofunction:: vectorize +.. autofunction:: vectorize_n_args Numpy workarounds ----------------- @@ -81,18 +81,20 @@ THE SOFTWARE. """ -from functools import partial, update_wrapper +from functools import partial, update_wrapper, wraps from typing import ( TYPE_CHECKING, Any, Generic, + Literal, TypeAlias, TypeVar, cast, overload, ) +from warnings import warn -from typing_extensions import Self, override +from typing_extensions import Self, Unpack, deprecated, override # NOTE: Importing this must not require importing numpy, so do not be tempted @@ -103,6 +105,7 @@ from collections.abc import Callable, Hashable, Iterator, Sequence import numpy as np + from numpy.typing import NDArray T = TypeVar("T", covariant=True) @@ -316,7 +319,7 @@ def from_numpy( return cast("ObjectArray[ShapeT, T]", cast("object", ary)) -def make_obj_array(res_list: Sequence[T]) -> ObjectArray1D[T]: +def new_1d(res_list: Sequence[T]) -> ObjectArray1D[T]: """Create a one-dimensional object array from *res_list*. This differs from ``numpy.array(res_list, dtype=object)`` by whether it tries to determine its shape by descending @@ -332,8 +335,8 @@ def make_obj_array(res_list: Sequence[T]) -> ObjectArray1D[T]: >>> a.shape (2, 5) >>> # meanwhile: - >>> from pytools.obj_array import make_obj_array - >>> b = make_obj_array([np.arange(5), np.arange(5)]) + >>> from pytools.obj_array import new_1d + >>> b = new_1d([np.arange(5), np.arange(5)]) >>> b array([array([0, 1, 2, 3, 4]), array([0, 1, 2, 3, 4])], dtype=object) >>> b.shape @@ -342,6 +345,10 @@ def make_obj_array(res_list: Sequence[T]) -> ObjectArray1D[T]: In some settings (such as when the sub-arrays are large and/or live on a GPU), the recursive behavior of :func:`numpy.array` can be undesirable. + + .. versionadded:: 2025.2.2 + + Renamed from ``make_obj_array``. """ import numpy as np result = np.empty((len(res_list),), dtype=object) @@ -354,7 +361,10 @@ def make_obj_array(res_list: Sequence[T]) -> ObjectArray1D[T]: return cast("ObjectArray1D[T]", cast("object", result)) -def obj_array_to_hashable(ary: ObjectArray[ShapeT, T] | Hashable, /) -> Hashable: +@deprecated("use obj_array.new_1d instead") +def make_obj_array(res_list: Sequence[T]) -> ObjectArray1D[T]: + # No run-time warning yet to avoid excessive warning spam. + return new_1d(res_list) def stack( @@ -395,13 +405,21 @@ def trace( """ import numpy as np return cast("T", np.trace(cast("NDArray[Any]", cast("object", array)))) + + +def to_hashable(ary: ObjectArray[ShapeT, T] | Hashable, /) -> Hashable: if isinstance(ary, ObjectArray): ary = cast("ObjectArray[ShapeT, T]", ary) return tuple(ary.flat.tolist()) return ary -def flat_obj_array(*args: ObjectArray[ShapeT, T] | list[T] | T) -> ObjectArray1D[T]: +@deprecated("use obj_array.to_hashable") +def obj_array_to_hashable(ary: ObjectArray[ShapeT, T] | Hashable, /) -> Hashable: + return to_hashable(ary) + + +def flat(*args: ObjectArray[ShapeT, T] | list[T] | T) -> ObjectArray1D[T]: """Return a one-dimensional flattened object array consisting of elements obtained by 'flattening' *args* as follows: @@ -423,23 +441,30 @@ def flat_obj_array(*args: ObjectArray[ShapeT, T] | list[T] | T) -> ObjectArray1D else: res_list.append(cast("T", arg)) - return make_obj_array(res_list) + return new_1d(res_list) + + +@deprecated("use obj_array.flat") +def flat_obj_array(*args: ObjectArray[ShapeT, T] | list[T] | T) -> ObjectArray1D[T]: + warn("flat_obj_array is deprecated, use obj_array.flat instead. " + "This will stop working in 2027.", DeprecationWarning, stacklevel=2) + return flat(*args) @overload -def obj_array_vectorize( +def vectorize( f: Callable[[T], ResultT], ary: ObjectArray[ShapeT, T], ) -> ObjectArray[ShapeT, ResultT]: ... @overload -def obj_array_vectorize( +def vectorize( f: Callable[[T], ResultT], ary: T, ) -> ResultT: ... -def obj_array_vectorize( +def vectorize( f: Callable[[T], ResultT], ary: T | ObjectArray[ShapeT, T], ) -> ResultT | ObjectArray[ShapeT, ResultT]: @@ -451,7 +476,7 @@ def obj_array_vectorize( .. note :: This function exists because :class:`numpy.vectorize` suffers from the same - issue described under :func:`make_obj_array`. + issue described under :func:`new_1d`. """ import numpy as np @@ -465,19 +490,38 @@ def obj_array_vectorize( return f(ary) +@deprecated("use obj_array.vectorize") +def obj_array_vectorize( + f: Callable[[T], ResultT], + ary: T | ObjectArray[ShapeT, T], + ) -> ResultT | ObjectArray[ShapeT, ResultT]: + warn("obj_array_vectorize is deprecated, use obj_array.vectorize instead. " + "This will stop working in 2027.", DeprecationWarning, stacklevel=2) + return vectorize(f, ary) + + # FIXME: It'd be nice to do make this more precise (T->T, ObjArray->ObjArray), # but I don't know how. -def obj_array_vectorized( +def vectorized( f: Callable[[T], T] ) -> Callable[[T | ObjectArray[ShapeT, T]], T | ObjectArray[ShapeT, T]]: - wrapper = partial(obj_array_vectorize, f) + wrapper = partial(vectorize, f) update_wrapper(wrapper, f) return wrapper # pyright: ignore[reportReturnType] +@deprecated("use obj_array.vectorized instead") +def obj_array_vectorized( + f: Callable[[T], T] + ) -> Callable[[T | ObjectArray[ShapeT, T]], T | ObjectArray[ShapeT, T]]: + warn("obj_array_vectorized is deprecated, use obj_array.vectorized instead. " + "This will stop working in 2027.", DeprecationWarning, stacklevel=2) + return vectorized(f) + + # FIXME: I don't know that this function *can* be precisely typed. # We could probably handle a few specific nesting levels, but is it worth it? -def rec_obj_array_vectorize( +def rec_vectorize( f: Callable[[object], object], ary: object | ObjectArray[ShapeT, object] ) -> object | ObjectArray[ShapeT, object]: @@ -492,30 +536,41 @@ def rec_obj_array_vectorize( .. note :: This function exists because :class:`numpy.vectorize` suffers from the same - issue described under :func:`make_obj_array`. + issue described under :func:`new_1d`. """ if isinstance(ary, ObjectArray): import numpy as np ary = cast("ObjectArray[ShapeT, object]", ary) result = np.empty_like(ary) for i in np.ndindex(ary.shape): - result[i] = rec_obj_array_vectorize(f, ary[i]) + result[i] = rec_vectorize(f, ary[i]) return cast("ObjectArray[Any, ShapeT]", cast("object", result)) return f(ary) +@deprecated("use obj_array.rec_vectorize instead") +def rec_obj_array_vectorize( + f: Callable[[object], object], + ary: object | ObjectArray[ShapeT, object] + ) -> object | ObjectArray[ShapeT, object]: + warn("rec_obj_array_vectorized is deprecated, " + "use obj_array.rec_vectorized instead. " + "This will stop working in 2027.", DeprecationWarning, stacklevel=2) + return rec_vectorize(f, ary) + + def rec_obj_array_vectorized( f: Callable[[object], ResultT] ) -> Callable[ [object | ObjectArray[ShapeT, object]], object | ObjectArray[ShapeT, object]]: - wrapper = partial(rec_obj_array_vectorize, f) + wrapper = partial(rec_vectorize, f) update_wrapper(wrapper, f) return wrapper -def obj_array_vectorize_n_args(f, *args): +def vectorize_n_args(f, *args): """Apply the function *f* elementwise to all entries of any object arrays in *args*. All such object arrays are expected to have the same shape (but this is not checked). @@ -529,7 +584,7 @@ def obj_array_vectorize_n_args(f, *args): .. note :: This function exists because :class:`numpy.vectorize` suffers from the same - issue described under :func:`make_obj_array`. + issue described under :func:`new_1d`. """ import numpy as np oarray_arg_indices = [] @@ -552,7 +607,15 @@ def obj_array_vectorize_n_args(f, *args): return result -def obj_array_vectorized_n_args(f): +@deprecated("use obj_array.vectorize_n_args") +def obj_array_vectorize_n_args(f, *args): + warn("obj_array_vectorize_n_args is deprecated, " + "use obj_array.vectorize_n_args instead. " + "This will stop working in 2027.", DeprecationWarning, stacklevel=2) + return obj_array_vectorize_n_args(f, *args) + + +def vectorized_n_args(f): # Unfortunately, this can't use partial(), as the callable returned by it # will not be turned into a bound method upon attribute access. # This may happen here, because the decorator *could* be used @@ -566,29 +629,37 @@ def obj_array_vectorized_n_args(f): # > other callable objects (and all non-callable objects) are retrieved # > without transformation. + @wraps(f) def wrapper(*args): - return obj_array_vectorize_n_args(f, *args) + return vectorize_n_args(f, *args) - update_wrapper(wrapper, f) return wrapper +@deprecated("use obj_array.vectorized_n_args") +def obj_array_vectorized_n_args(f): + warn("obj_array_vectorized_n_args is deprecated, " + "use obj_array.vectorized_n_args instead. " + "This will stop working in 2027.", DeprecationWarning, stacklevel=2) + return vectorized_n_args(f) + + # {{{ workarounds for https://github.com/numpy/numpy/issues/1740 def obj_array_real(ary): - return rec_obj_array_vectorize(lambda x: x.real, ary) + return rec_vectorize(lambda x: x.real, ary) def obj_array_imag(ary): - return rec_obj_array_vectorize(lambda x: x.imag, ary) + return rec_vectorize(lambda x: x.imag, ary) def obj_array_real_copy(ary): - return rec_obj_array_vectorize(lambda x: x.real.copy(), ary) + return rec_vectorize(lambda x: x.real.copy(), ary) def obj_array_imag_copy(ary): - return rec_obj_array_vectorize(lambda x: x.imag.copy(), ary) + return rec_vectorize(lambda x: x.imag.copy(), ary) # }}} diff --git a/pytools/test/test_pytools.py b/pytools/test/test_pytools.py index 4172f251..45bb3ea9 100644 --- a/pytools/test/test_pytools.py +++ b/pytools/test/test_pytools.py @@ -416,8 +416,8 @@ def __getitem__(self, idx): def test_make_obj_array_iteration(): pytest.importorskip("numpy") - from pytools.obj_array import make_obj_array - make_obj_array([FakeArray()]) + import pytools.obj_array as obj_array + obj_array.new_1d([FakeArray()]) assert FakeArray.nopes == 0, FakeArray.nopes @@ -430,9 +430,9 @@ def test_obj_array_vectorize(c=1): np = pytest.importorskip("numpy") la = pytest.importorskip("numpy.linalg") - # {{{ functions + import pytools.obj_array as obj_array - import pytools.obj_array as obj + # {{{ functions def add_one(ary): assert ary.dtype.char != "O" @@ -442,12 +442,12 @@ def two_add_one(x, y): assert x.dtype.char != "O" and y.dtype.char != "O" return x * y + c - @obj.obj_array_vectorized + @obj_array.vectorized def vectorized_add_one(ary): assert ary.dtype.char != "O" return ary + c - @obj.obj_array_vectorized_n_args + @obj_array.vectorized_n_args def vectorized_two_add_one(x, y): assert x.dtype.char != "O" and y.dtype.char != "O" return x * y + c @@ -460,7 +460,7 @@ def add(self, ary): assert ary.dtype.char != "O" return ary + self.c - @obj.obj_array_vectorized_n_args + @obj_array.vectorized_n_args def vectorized_add(self, ary): assert ary.dtype.char != "O" return ary + self.c @@ -472,12 +472,12 @@ def vectorized_add(self, ary): # {{{ check scalar_ary = np.ones(42, dtype=np.float64) - object_ary = obj.make_obj_array([scalar_ary, scalar_ary, scalar_ary]) + object_ary = obj_array.new_1d([scalar_ary, scalar_ary, scalar_ary]) for func, vectorizer, nargs in [ - (add_one, obj.obj_array_vectorize, 1), - (two_add_one, obj.obj_array_vectorize_n_args, 2), - (adder.add, obj.obj_array_vectorize, 1), + (add_one, obj_array.vectorize, 1), + (two_add_one, obj_array.vectorize_n_args, 2), + (adder.add, obj_array.vectorize, 1), ]: input_ary = [scalar_ary] * nargs result = vectorizer(func, *input_ary) From edb28efcc1a8c2dc6fea3a1369980f4e148dfb31 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 15 Jul 2025 18:12:08 -0500 Subject: [PATCH 5/6] Update baseline --- .basedpyright/baseline.json | 242 ++++++++++++++++++++++++++---------- 1 file changed, 173 insertions(+), 69 deletions(-) diff --git a/.basedpyright/baseline.json b/.basedpyright/baseline.json index 5ccd32ec..14af9879 100644 --- a/.basedpyright/baseline.json +++ b/.basedpyright/baseline.json @@ -10601,39 +10601,39 @@ "code": "reportUnknownParameterType", "range": { "startColumn": 4, - "endColumn": 30, + "endColumn": 20, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 31, - "endColumn": 32, + "startColumn": 21, + "endColumn": 22, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 31, - "endColumn": 32, + "startColumn": 21, + "endColumn": 22, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 35, - "endColumn": 39, + "startColumn": 25, + "endColumn": 29, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 35, - "endColumn": 39, + "startColumn": 25, + "endColumn": 29, "lineCount": 1 } }, @@ -10761,23 +10761,103 @@ "code": "reportUnknownParameterType", "range": { "startColumn": 4, - "endColumn": 31, + "endColumn": 30, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 32, - "endColumn": 33, + "startColumn": 31, + "endColumn": 32, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 32, - "endColumn": 33, + "startColumn": 31, + "endColumn": 32, + "lineCount": 1 + } + }, + { + "code": "reportUnknownParameterType", + "range": { + "startColumn": 35, + "endColumn": 39, + "lineCount": 1 + } + }, + { + "code": "reportMissingParameterType", + "range": { + "startColumn": 35, + "endColumn": 39, + "lineCount": 1 + } + }, + { + "code": "reportUnknownVariableType", + "range": { + "startColumn": 11, + "endColumn": 47, + "lineCount": 1 + } + }, + { + "code": "reportDeprecated", + "range": { + "startColumn": 11, + "endColumn": 37, + "lineCount": 1 + } + }, + { + "code": "reportUnknownArgumentType", + "range": { + "startColumn": 38, + "endColumn": 39, + "lineCount": 1 + } + }, + { + "code": "reportUnknownArgumentType", + "range": { + "startColumn": 42, + "endColumn": 46, + "lineCount": 1 + } + }, + { + "code": "reportUnknownParameterType", + "range": { + "startColumn": 4, + "endColumn": 21, + "lineCount": 1 + } + }, + { + "code": "reportUnknownParameterType", + "range": { + "startColumn": 22, + "endColumn": 23, + "lineCount": 1 + } + }, + { + "code": "reportMissingParameterType", + "range": { + "startColumn": 22, + "endColumn": 23, + "lineCount": 1 + } + }, + { + "code": "reportUnknownArgumentType", + "range": { + "startColumn": 11, + "endColumn": 12, "lineCount": 1 } }, @@ -10809,39 +10889,55 @@ "code": "reportUnknownVariableType", "range": { "startColumn": 15, - "endColumn": 51, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 42, - "endColumn": 43, + "startColumn": 32, + "endColumn": 33, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 46, - "endColumn": 50, + "startColumn": 36, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 19, - "endColumn": 26, + "startColumn": 11, + "endColumn": 18, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 28, - "endColumn": 29, + "startColumn": 4, + "endColumn": 31, + "lineCount": 1 + } + }, + { + "code": "reportUnknownParameterType", + "range": { + "startColumn": 32, + "endColumn": 33, + "lineCount": 1 + } + }, + { + "code": "reportMissingParameterType", + "range": { + "startColumn": 32, + "endColumn": 33, "lineCount": 1 } }, @@ -10849,7 +10945,15 @@ "code": "reportUnknownVariableType", "range": { "startColumn": 11, - "endColumn": 18, + "endColumn": 31, + "lineCount": 1 + } + }, + { + "code": "reportUnknownArgumentType", + "range": { + "startColumn": 29, + "endColumn": 30, "lineCount": 1 } }, @@ -10881,39 +10985,39 @@ "code": "reportUnknownVariableType", "range": { "startColumn": 11, - "endColumn": 57, + "endColumn": 47, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 45, - "endColumn": 51, + "startColumn": 35, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownLambdaType", "range": { - "startColumn": 45, - "endColumn": 51, + "startColumn": 35, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportAttributeAccessIssue", "range": { - "startColumn": 47, - "endColumn": 51, + "startColumn": 37, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 53, - "endColumn": 56, + "startColumn": 43, + "endColumn": 46, "lineCount": 1 } }, @@ -10945,39 +11049,39 @@ "code": "reportUnknownVariableType", "range": { "startColumn": 11, - "endColumn": 57, + "endColumn": 47, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 45, - "endColumn": 51, + "startColumn": 35, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownLambdaType", "range": { - "startColumn": 45, - "endColumn": 51, + "startColumn": 35, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportAttributeAccessIssue", "range": { - "startColumn": 47, - "endColumn": 51, + "startColumn": 37, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 53, - "endColumn": 56, + "startColumn": 43, + "endColumn": 46, "lineCount": 1 } }, @@ -11009,47 +11113,47 @@ "code": "reportUnknownVariableType", "range": { "startColumn": 11, - "endColumn": 64, + "endColumn": 54, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 45, - "endColumn": 51, + "startColumn": 35, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 45, - "endColumn": 56, + "startColumn": 35, + "endColumn": 46, "lineCount": 1 } }, { "code": "reportUnknownLambdaType", "range": { - "startColumn": 45, - "endColumn": 58, + "startColumn": 35, + "endColumn": 48, "lineCount": 1 } }, { "code": "reportAttributeAccessIssue", "range": { - "startColumn": 47, - "endColumn": 51, + "startColumn": 37, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 60, - "endColumn": 63, + "startColumn": 50, + "endColumn": 53, "lineCount": 1 } }, @@ -11081,47 +11185,47 @@ "code": "reportUnknownVariableType", "range": { "startColumn": 11, - "endColumn": 64, + "endColumn": 54, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 45, - "endColumn": 51, + "startColumn": 35, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 45, - "endColumn": 56, + "startColumn": 35, + "endColumn": 46, "lineCount": 1 } }, { "code": "reportUnknownLambdaType", "range": { - "startColumn": 45, - "endColumn": 58, + "startColumn": 35, + "endColumn": 48, "lineCount": 1 } }, { "code": "reportAttributeAccessIssue", "range": { - "startColumn": 47, - "endColumn": 51, + "startColumn": 37, + "endColumn": 41, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 60, - "endColumn": 63, + "startColumn": 50, + "endColumn": 53, "lineCount": 1 } } @@ -16305,7 +16409,7 @@ "code": "reportUnknownMemberType", "range": { "startColumn": 5, - "endColumn": 36, + "endColumn": 32, "lineCount": 1 } }, @@ -16465,7 +16569,7 @@ "code": "reportUnknownMemberType", "range": { "startColumn": 9, - "endColumn": 40, + "endColumn": 36, "lineCount": 1 } }, @@ -16537,7 +16641,7 @@ "code": "reportUnknownMemberType", "range": { "startColumn": 26, - "endColumn": 56, + "endColumn": 52, "lineCount": 1 } }, From 6af0ef5edc92795aed1776f56210fdec05be8c42 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 15 Jul 2025 18:12:13 -0500 Subject: [PATCH 6/6] Bump version to 2025.2.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 87f03eaa..914ce17e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "pytools" -version = "2025.2.1" +version = "2025.2.2" description = "A collection of tools for Python" readme = "README.rst" license = "MIT"