From 92d36393948f077e3c76baea32f0bfadeed013ff Mon Sep 17 00:00:00 2001 From: "[6~" Date: Fri, 5 Jun 2020 10:34:33 -0500 Subject: [PATCH] Deprecate indices_in_shape --- pytools/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 0567920..e5efcb2 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -86,7 +86,6 @@ Permutations, Tuples, Integer sequences --------------------------------------- .. autofunction:: wandering_element -.. autofunction:: indices_in_shape .. autofunction:: generate_nonnegative_integer_tuples_below .. autofunction:: generate_nonnegative_integer_tuples_summing_to_at_most .. autofunction:: generate_all_nonnegative_integer_tuples @@ -1170,6 +1169,10 @@ def wandering_element(length, wanderer=1, landscape=0): def indices_in_shape(shape): + from warnings import warn + warn("indices_in_shape is deprecated. You should prefer numpy.ndindex.", + DeprecationWarning, stacklevel=2) + if isinstance(shape, int): shape = (shape,) -- GitLab