-
Notifications
You must be signed in to change notification settings - Fork 626
Automatically infer a strategy for dtype="object"
#4444
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
Open
philastrophist
wants to merge
43
commits into
HypothesisWorks:master
Choose a base branch
from
philastrophist:allow_objects_in_numpy_arrays_and_pandas_series
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+227
−19
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
77fc61e
- Accept dtype.kind = 'O' in `from_dtype`
895e360
ruff: yes we really want .iat
8fe26b8
linting
d2bf820
add test for failing coverage and dtypes
918a9f0
linter
b514789
rst mistakes and linting
07f8ea0
comparable datatypes only
aa0ab3f
still keep the else line to catch unknown dtypes but remove from cove…
b9380b7
make test agree with the from_dtype strategy
e0c2909
formatting
6aea8bc
addressed comments :)
b65e335
formatting
212a628
formatting
088d272
Got rst sytnax wrong again...
c52bb66
Merge branch 'master' into allow_objects_in_numpy_arrays_and_pandas_s…
Liam-DeVoe f8b6ad6
clean up some things
Liam-DeVoe 56ce942
restrict objects allowed in arrays, better tests
d9d5c2e
linting
ee7ac5d
linting
1975676
formatting
d0d57f4
Revert "formatting"
f471a18
formatting
1d6b5aa
use proper linting tooling
7556a9a
Merge branch 'master' into allow_objects_in_numpy_arrays_and_pandas_s…
Liam-DeVoe 74520e3
cleaned up and simplified the implementation a lot (particularly in p…
f87f00d
formatting/linting
a32eb9c
removed assert_safe_equals; using list equality now
877212e
Merge branch 'master' into allow_objects_in_numpy_arrays_and_pandas_s…
philastrophist 6226f0e
not sure how that happened
704d80e
Merge remote-tracking branch 'upstream/master' into allow_objects_in_…
808c01c
format
77fac3b
Merge branch 'master' into allow_objects_in_numpy_arrays_and_pandas_s…
Liam-DeVoe c1d6fc4
Merge branch 'allow_objects_in_numpy_arrays_and_pandas_series' of git…
Liam-DeVoe 631ff0f
refactor tests
Liam-DeVoe 1f70970
simplify numpy code
Liam-DeVoe 5982df7
format
Liam-DeVoe b26eaac
bring back array equality check
Liam-DeVoe d3e5f3b
comment, weaker series dtype test
Liam-DeVoe adab86e
simplify pandas code
Liam-DeVoe a2b28b1
Merge branch 'master' into allow_objects_in_numpy_arrays_and_pandas_s…
Liam-DeVoe 1ec77f5
refactor
Liam-DeVoe 6e39885
xfail pandas object test
Liam-DeVoe 003b239
nonstrict
Liam-DeVoe 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -175,6 +175,7 @@ their individual contributions. | |
| * `Saul Shanabrook <https://www.github.com/saulshanabrook>`_ ([email protected]) | ||
| * `Sebastiaan Zeeff <https://github.com/SebastiaanZ>`_ ([email protected]) | ||
| * `Sharyar Memon <https://github.com/sharyar>`_ ([email protected]) | ||
| * `Shaun Read <https://github.com/philastrophist>`_ | ||
| * `Shlok Gandhi <https://github.com/shlok57>`_ ([email protected]) | ||
| * `Sogata Ray <https://github.com/rayardinanda>`_ ([email protected]) | ||
| * `Stuart Cook <https://www.github.com/Zalathar>`_ | ||
|
|
||
This file contains hidden or 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,5 @@ | ||
| RELEASE_TYPE: minor | ||
|
|
||
| The extras for |hypothesis-numpy| and |hypothesis-pandas| now support automatically inferring a strategy for ``dtype="O"``. Previously, Hypothesis required an explicit elements strategy to be passed, for example ``nps.arrays("O", shape=(1,), elements=st.just(object()))``. Now, Hypothesis automatically infers ``elements=st.from_type(object)``. | ||
|
|
||
| Thanks to Shaun Read for identifying and fixing this! |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
it's not actually clear to me whether we want
st.from_type(object)orfrom_type(type).flatmap(st.from_type)here. Should we make the former simply register to the latter?