From 217c38557be09f969a177f07c0c6d440695f1cd6 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Sun, 11 Feb 2024 13:12:23 +0300 Subject: Intermediate changes --- contrib/python/hypothesis/py3/.dist-info/METADATA | 2 +- contrib/python/hypothesis/py3/hypothesis/extra/numpy.py | 14 ++++++++++++-- contrib/python/hypothesis/py3/hypothesis/version.py | 2 +- contrib/python/hypothesis/py3/ya.make | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) (limited to 'contrib/python') diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA index 135737b7315..8338cfd8cc6 100644 --- a/contrib/python/hypothesis/py3/.dist-info/METADATA +++ b/contrib/python/hypothesis/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: hypothesis -Version: 6.97.0 +Version: 6.97.1 Summary: A library for property-based testing Home-page: https://hypothesis.works Author: David R. MacIver and Zac Hatfield-Dodds diff --git a/contrib/python/hypothesis/py3/hypothesis/extra/numpy.py b/contrib/python/hypothesis/py3/hypothesis/extra/numpy.py index 396b9498fe3..29d73f76be4 100644 --- a/contrib/python/hypothesis/py3/hypothesis/extra/numpy.py +++ b/contrib/python/hypothesis/py3/hypothesis/extra/numpy.py @@ -46,8 +46,14 @@ from hypothesis.internal.conjecture import utils as cu from hypothesis.internal.coverage import check_function from hypothesis.internal.reflection import proxies from hypothesis.internal.validation import check_type +from hypothesis.strategies._internal.lazy import unwrap_strategies from hypothesis.strategies._internal.numbers import Real -from hypothesis.strategies._internal.strategies import Ex, T, check_strategy +from hypothesis.strategies._internal.strategies import ( + Ex, + MappedSearchStrategy, + T, + check_strategy, +) from hypothesis.strategies._internal.utils import defines_strategy @@ -393,7 +399,6 @@ class ArrayStrategy(st.SearchStrategy): return result -@check_function def fill_for(elements, unique, fill, name=""): if fill is None: if unique or not elements.has_reusable_values: @@ -508,6 +513,11 @@ def arrays( ) elements = from_dtype(dtype, **(elements or {})) check_strategy(elements, "elements") + # If there's a redundant cast to the requested dtype, remove it. This unlocks + # optimizations such as fast unique sampled_from, and saves some time directly too. + unwrapped = unwrap_strategies(elements) + if isinstance(unwrapped, MappedSearchStrategy) and unwrapped.pack == dtype.type: + elements = unwrapped.mapped_strategy if isinstance(shape, int): shape = (shape,) shape = tuple(shape) diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py index 41fe61ff7ef..81c33333c35 100644 --- a/contrib/python/hypothesis/py3/hypothesis/version.py +++ b/contrib/python/hypothesis/py3/hypothesis/version.py @@ -8,5 +8,5 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. -__version_info__ = (6, 97, 0) +__version_info__ = (6, 97, 1) __version__ = ".".join(map(str, __version_info__)) diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make index 8be1df19a1c..b2ecf2aa296 100644 --- a/contrib/python/hypothesis/py3/ya.make +++ b/contrib/python/hypothesis/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.97.0) +VERSION(6.97.1) LICENSE(MPL-2.0) -- cgit v1.3