8000 ENH: Add shape to *_like() array creation by pentschev · Pull Request #13046 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Add shape to *_like() array creation #13046

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 24 commits into from
Apr 25, 2019
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f885c08
ENH: Added shape argument to *_like() array creation functions
pentschev Feb 26, 2019
5ad61b6
ENH: C backend adjustments for shape argument on *_like()
pentschev Feb 26, 2019
fd3e270
TST: Added test for shape argument in *_like() functions
pentschev Feb 26, 2019
b7202a7
ENH: Added PyArray_NewLikeArrayWithShape()
pentschev Feb 26, 2019
013cbce
BUG: Fix for PyArray_NewLikeArrayWithShape strides and ndim == 0
pentschev Feb 27, 2019
807f512
REL: Updates for C-API, version 1.17.x
pentschev Feb 27, 2019
95bbfd0
Revert "REL: Updates for C-API, version 1.17.x"
pentschev Mar 13, 2019
43b9828
Revert exposing PyArray_NewLikeArrayWithShape on C-API
pentschev Mar 13, 2019
fa7fd75
DOC: fix versionadded for *_like() shape argument
pentschev Mar 13, 2019
d57e6d3
STY: add missing spaces in array initializers
pentschev Mar 13, 2019
f1b3e91
ENH: empty_like raises ValueError
pentschev Mar 16, 2019
d24ac10
TST: test for exception of *_like() functions
pentschev Mar 16, 2019
ec26417
DOC: release note for shape argument in *_like() functions
pentschev Mar 16, 2019
40e7e9e
DOC: fix *_like() documentation on raises
pentschev Mar 17, 2019
928952d
BUG: *_like() raises for non-C/F-layout arrays
pentschev Mar 17, 2019
e394356
TST: change *_like() shapes to prevent NPY_RELAXED_STRIDE_DEBUG=1 fai…
pentschev Mar 17, 2019
d938fb9
Move empty_like() exception to C implementation
pentschev Mar 19, 2019
99a55e0
Merge branch 'master' into add-shape-to-like-array-creation
pentschev Mar 28, 2019
c087801
Update *_like() ValueError documentation
pentschev Apr 4, 2019
db7614b
Merge remote-tracking branch 'upstream/master' into add-shape-to-like…
pentschev Apr 5, 2019
669ea71
Rearrange stride computation for *_like() if new shape and order='K'
pentschev Apr 10, 2019
f53afbe
Change handling of order= for *_like()
pentschev Apr 19, 2019
c3ac08e
Merge branch 'master' into add-shape-to-like-array-creation
pentschev Apr 19, 2019
695b836
Fix *_like() tests
pentschev Apr 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOC: release note for shape argument in *_like() functions
  • Loading branch information
pentschev committed Mar 16, 2019
commit ec264171ff43693c306ba0cf29d088d02412a166
9 changes: 9 additions & 0 deletions doc/release/1.17.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ divmod operation is now supported for two ``timedelta64`` operands
The divmod operator now handles two ``np.timedelta64`` operands, with
type signature mm->qm.

``np.empty_like`` and related functions now accept a ``shape`` argument
-----------------------------------------------------------------------
``np.empty_like``, ``np.full_like``, ``np.ones_like`` and ``np.zeros_like`` now
accept a ``shape`` keyword argument, which can be used to create a new array
as the prototype, overriding its shape as well. This is particularly useful
when combined with the ``__array_function__`` protocol, allowing the creation
of new arbitrary-shape arrays from NumPy-like libraries when such an array
is used as the prototype.


Improvements
============
Expand Down
0