-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: Rewrite of array-coercion to support new dtypes #16200
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
b5dc1ed
WIP: Rework array coercion
seberg f5df08c
WIP: Further steps toward new coercion, start with making discovery p…
seberg 63bb417
Close to the first working setup
seberg 28c8b39
WIP: Some cleanup/changes?
seberg b204379
WIP: Make things work by using AdaptFlexibleDType (without obj) for now
seberg 5bd5847
Use new mechanism for np.asarray, and hopefully get void right, har
seberg 9e03d8d
First version mainly working
seberg efbe979
Further fixes, make max-dims reached more logical and enter obj arrays
seberg a552d2a
TST: Small test adjustments
seberg 2cfcf56
WIP: Seems pretty good, but needs cleaning up...
seberg 302813c
Smaller cleanups, better errors mainly?
seberg cec10fb
Fixup for scalar kind, and ensure OBJECT is special for assignment
seberg 1eaca02
Use PyArray_Pack in a few other places
seberg 3f5e4a2
Some micro-optimization tries (should probably be largely reverted)
seberg 1896813
Optimize away filling all dims with -1 at the start
seberg c7e7dd9
Other smallre changes, some optimization related.
seberg 60fa9b9
Small bug fixup and rebase on master
seberg e20dded
Fixups/comments for compiler warnings
seberg 4e0029d
update some comments, remove outdated old code path
seberg ad31a32
Small fixups/comment changes
seberg ca09045
BUG: Make static declaration safe (may be an issue on msvc mostly)
seberg 9ceeb97
Replace AdaptFlexibleDType with object and delete some datetime thing…
seberg 4a04e89
Add somewhat disgusting hacks for datetime support
seberg 08a4687
MAINT: Remove use of PyArray_GetParamsFromObject from PyArray_CopyObject
seberg a1ee25a
MAINT: Delete legacy dtype discovery
seberg 1405a30
Allow returning NULL for dtype when there is no object to discover from
seberg a7c5a59
BUG: Smaller fixes in object-array parametric discovery
seberg 75a728f
BUG: remove incorrect assert
seberg b09217c
BUG: When filling an array from the cache, store original for objects
seberg b28b2a1
BUG: Fix discovery for empty lists
seberg 7a343c6
BUG: Add missing DECREF
seberg 7d1489a
Fixups: Some smaller fixups and comments to ensure we have tests
seberg 946edc8
BUG: Add missing error check
seberg 002fa2f
BUG: Reorder dimension fix/check and promotion
seberg 29f1515
BUG: Add missing cache free...
seberg ba0a6d0
BUG: Fixup for PyArray_Pack
seberg b3544a1
BUG: Fix use after free in PyArray_CopyObject
seberg bcd3320
BUG: Need to set the base field apparently and swap promotion
seberg 454d785
MAINT: Use flag to indicate that dtype discovery is not necessary
seberg 68cd028
MAINT: Fixups (some based on new tests), almost finished
seberg 1035c3f
MAINT: Use macros/functions instead of direct slot access
seberg e30cbfb
MAINT: Delete PyArray_AssignFromSequence
seberg 56c63d8
MAINT: Undo change of how 0-D array-likes are handled as scalars
seberg 605588c
MAINT: Undo some header changes...
seberg 4eb9cfd
MAINT: Try to clean up headers a bit
seberg 4ac514f
TST: Add test for too-deep non-object deprecation
seberg 8a7f0e6
MAINt: Add assert for an unreachable exception path
seberg 7012ef7
TST: Adapt coercion-tests to the new situation
seberg 3ccf696
DOC: Add release notes for array-coercion changes
seberg 6ff4d48
MAINT: Remove weakref from mapping (for now) and rename
seberg e3f091e
Update numpy/core/src/multiarray/array_coercion.c
seberg 4fe0ad2
MAINT: Put a hack in place to allow datetime64 -> string assignment w…
seberg d39953c
Update doc/release/upcoming_changes/16200.compatibility.rst
seberg b36750b
TST: datetime64 test_scalar_coercion does not fail anymore
seberg 0f78129
Update doc/release/upcoming_changes/16200.compatibility.rst
mattip aee13e0
DOC,STY: Use bitshift intsead of powers of two and fix comments
seberg 22ee971
TST: Add test for astype to stringlength tests
seberg 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
Replace AdaptFlexibleDType with object and delete some datetime thing…
… related This fails two tests (but behaviour is better now). The string->datetime unit discovery for string arrays is hard-coded now, and IMO should be deprecated at some point, if necessary we can add a specific function for it maybe? Unless we really want to make this pattern a first class citizen (and not special case object). But I am against that until someone finds a better use-case...
- Loading branch information
commit 9ceeb97debefda7931ab8312d50f3cc4cb81c956
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
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
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.
in my opinion this should be useful!
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.
We could support it in coercion. In general, I think its nicer to just use types (e.g. float32 -> S32, etc.) without looking at values (that also gives type safety). For coercion, looking at values can be nice I guess, within ufuncs I am not sure. It feels like it just creates complexities that are probably unnecessary.
You can always create a small utility functions to do most of these things. But yes, I guess it is a plausible addition, but I am not keen rushing it :). I could make the comment less judgmental ;)