-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfixes in inference from Numpy dtypes #826
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d000b3
Allow all representable integers in inferred strats
Zac-HD afed367
Improve string support in inferred Numpy strategies
Zac-HD 145bec5
Test that we can round-trip all examples
Zac-HD 5d99e09
Fix updating benchmarks
Zac-HD 8852051
New and improved benchmarks
Zac-HD 28bec79
Fix overflow in Pandas extra and avoid old bug
Zac-HD 02940c2
Fix overflow in pd.RangeIndex sizes
Zac-HD a40e448
Clarify release notes, comments
Zac-HD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
RELEASE_TYPE: patch | ||
|
||
This patch improves the quality of strategies inferred from Numpy dtypes: | ||
|
||
* Integer dtypes generated examples with the upper half of their (non-sign) bits | ||
set to zero. The inferred strategies can now produce any representable integer. | ||
* Fixed-width unicode- and byte-string dtypes now cap the internal example | ||
length, which should improve example and shrink quality. | ||
* Numpy arrays can only store fixed-size strings internally, and allow shorter | ||
strings by right-padding them with null bytes. Inferred string strategies | ||
no longer generate such values, as they can never be retrieved from an array. | ||
This improves shrinking performance by skipping useless values. | ||
|
||
This has already been useful in Hypothesis - we found an overflow bug in our | ||
Pandas support, and as a result :func:`~hypothesis.extra.pandas.indexes` and | ||
:func:`~hypothesis.extra.pandas.range_indexes` now check that ``min_size`` | ||
and ``max_size`` are at least zero. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear what impact this has to the user. It's basically just a performance improvement, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - better shrinking because we know not to try null-terminated strings. I've added a line to that effect below.