Skip to content

Commit

Permalink
Clarified how axes and mutshape strategies are used with underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
honno committed Aug 28, 2021
1 parent 666098d commit 4ec21a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/extra/_array_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _hypothesis_parse_gufunc_signature(signature, all_checks=True):
if re.match("^{0:}->{0:}$".format(_ARGUMENT_LIST), signature):
raise InvalidArgument(
f"signature={signature!r} matches Numpy's regex for gufunc signatures, "
"but contains shapes with more than 32 dimensions and is thus invalid."
f"but contains shapes with more than {NDIM_MAX} dimensions and is thus invalid."
)
raise InvalidArgument(f"{signature!r} is not a valid gufunc signature")
input_shapes, output_shapes = (
Expand Down
12 changes: 6 additions & 6 deletions hypothesis-python/src/hypothesis/extra/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
broadcastable_shapes,
check_argument,
check_valid_dims,
mutually_broadcastable_shapes,
mutually_broadcastable_shapes as _mutually_broadcastable_shapes,
order_check,
valid_tuple_axes,
valid_tuple_axes as _valid_tuple_axes,
)
from hypothesis.internal.conjecture import utils as cu
from hypothesis.internal.coverage import check_function
Expand Down Expand Up @@ -732,20 +732,20 @@ def nested_dtypes(
).filter(lambda d: max_itemsize is None or d.itemsize <= max_itemsize)


valid_tuple_axes = deepcopy(valid_tuple_axes)
valid_tuple_axes = deepcopy(_valid_tuple_axes)
valid_tuple_axes.__doc__ = f"""
Return a strategy for generating permissible tuple-values for the
``axis`` argument for a numpy sequential function (e.g.
:func:`numpy:numpy.sum`), given an array of the specified
dimensionality.
{valid_tuple_axes.__doc__}
{_valid_tuple_axes.__doc__}
"""


mutually_broadcastable_shapes = deepcopy(mutually_broadcastable_shapes)
mutually_broadcastable_shapes = deepcopy(_mutually_broadcastable_shapes)
mutually_broadcastable_shapes.__doc__ = f"""
{mutually_broadcastable_shapes.__doc__}
{_mutually_broadcastable_shapes.__doc__}
**Use with Generalised Universal Function signatures**
Expand Down

0 comments on commit 4ec21a9

Please sign in to comment.