summaryrefslogtreecommitdiff
path: root/numpy/lib/shape_base.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: remove `NUMPY_EXPERIMENTAL_ARRAY_FUNCTION` env varRalf Gommers2023-03-121-8/+0
| | | | | | | | As discussed in https://mail.python.org/archives/list/numpy-discussion@python.org/thread/UKZJACAP5FUG7KP2AQDPE4P5ADNWLOHZ/ This flag was always meant to be temporary, and cleaning it up is long overdue.
* DEP: Finalize the non-sequence stacking deprecationSebastian Berg2023-01-171-4/+4
| | | | | | | | | The `__array_function__` API currently will exhaust iterators so we cannot accept sequences reasonably. Checking for `__getitem__` is presumably enough to reject that (and was what the deprecation used). Future changes could allow this again, although it is not a useful API anyway, since we have to materialize the iterable in any case.
* MAINT: lib: A bit of flake8-driven clean up in shape_base.pywarren2022-11-241-4/+4
|
* DOC: lib: Use keepdims in a couple docstrings.warren2022-11-241-7/+9
|
* MAINT: Added comment for kron workingGanesh Kathiresan2022-04-181-0/+9
|
* ENH: Improve `np.kron` performanceGanesh Kathiresan2022-04-181-6/+7
| | | | * Changed product computing logic for kron to use broadcasting
* ENH: Maintain subclass info for `np.kron`Ganesh Kathiresan2022-04-051-10/+6
| | | | | | * Replace `*` call with `multiply` * Handle `mat` cases to perform reshape * Remove use result wrapping to maintain consistency with ufuncs
* BUG: Convert other inputs to arrayGanesh Kathiresan2022-03-261-2/+4
| | | | Input such as matrix will cause a `ValueError` due to dim restrictions
* MAINT: Linting fixesGanesh Kathiresan2022-03-251-1/+1
|
* ENH: Refactor kron to not use concatGanesh Kathiresan2022-03-251-8/+15
|
* BUG: Refactor `np.kron` to handle 0 in shapeGanesh Kathiresan2022-03-221-11/+10
| | | | | | * `np.kron` uses `np.concatenate` which fails when shape is 0 along an axis * Refactor shape normalising portion.
* DOC: Include special case in `hsplit` doc (#20974)Bharat Raghunathan2022-02-091-1/+7
|
* ENH: Use new argument parsing for array creation functionsSebastian Berg2021-03-181-1/+1
| | | | | | | | | | | | | | | | | | The array creation functions have the most to gain: 1. np.asarray is 4 times faster and commonly used. 2. Other functions are wrapped using __array_function__ in Python making it more difficult This commit (unfortunatly) has to do a few things: * Modify __array_function__ C-side dispatching to accomodate the fastcall argument convention. * Move asarray, etc. to C after removing all "fast paths" from np.array (simplifying the code) * Fixup imports, since asarray was imported directly in a few places * Replace some places where `np.array` was probably used for speed instead of np.asarray or similar. (or by accident in 1 or 2 places)
* Fixed chain exception for array_split func (#18317)Abhay Raghuvanshi2021-02-101-1/+1
|
* DOC: lib/shape_base numpydoc formatting.Matthias Bussonnier2021-01-251-7/+7
| | | | | | Numpydoc parses parameter different depending on whether there is a space before the colon, for it to be properly interpreted as names and types; spaces need to be put on each side.
* [DOC] np.kron use double backticks for non-refsMatthias Bussonnier2020-12-131-2/+2
| | | | | | Some part of the docstring were between simple backticks which are therefore marked as cross-reference, while I belive the intended role is likely verbatim.
* MAINT: added exception chaining in shape_base.py (gh-17240)EthanCJ-git2020-09-031-1/+1
| | | | This edit is relation to issue gh-15986. Chained exception in shape_base.py
* DOC: Use a less ambiguous example for array_split (#17039)raisinghanii2020-08-101-4/+4
| | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* DOC: Minor RST formatting. (#16792)Matthias Bussonnier2020-07-091-1/+1
| | | DOC: fixes to capitalization and header lines
* DOC: Unify cross-references between array joining methodsTim Hoffmann2020-05-101-3/+5
|
* Update numpy/lib/shape_base.pyKerem Hallaç2020-04-251-1/+3
| | | Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
* ENH: Fix exception causes in four .py fileskeremh2020-04-241-2/+2
|
* DOC: fix documentation for apply_along_axis (#15619)Heshy Roskes2020-02-201-2/+2
|
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* ENH,DEP: Allow multiple axes in expand_dims (#14051)Larry Bradley2019-12-021-26/+41
| | | | | | | | | This PR allows the axis keyword in expand_dims to be a tuple of ints. Previously, axis could only be an int. This issue was previously discussed in gh-12290 and the changes are based on gh-12290 (comment). This PR also removes the deprecation added in v1.13 (2017-05-17), where previously axis could be outside of the range (-a.ndim - 1) <= axis <= a.ndim. Such an axis value will now raise an AxisError. Please let me know if it's too soon to remove this deprecation (I could not find any dev docs stating the length of the numpy deprecation cycle). Closes gh-12290.
* Mention that split() returns views into the original arrayFelix Divo2019-09-161-4/+3
| | | Also adds a minor code change
* MAINT: speed up [hvd]stack by eliminating list comprehension. (#13697)Marten van Kerkwijk2019-06-011-1/+4
|
* MAINT: Fixes tests with __array_function__ disabledStephan Hoyer2019-05-261-1/+9
|
* Fixed minor doc error in take_along_axisJavier Dehesa2019-05-211-1/+1
| | | Fixes #13598
* BUG: Increment stacklevel for warnings to account for NEP-18 overrides (#13589)Stephan Hoyer2019-05-201-1/+1
| | | | | | | | | | | | | | * Increment stacklevel for warnings to account for NEP-18 overrides For NumPy functions that make use of `__array_function__`, the appropriate the stack level for warnings should generally be increased by 1 to account for the override function defined in numpy.core.overrides. Fixes GH-13329 * Update numpy/lib/type_check.py Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
* Make wording changes according to @mattipBharat123rox2019-05-161-2/+1
|
* DOC: Mention that expand_dims returns a viewBharat123rox2019-05-161-1/+1
|
* ENH: __array_function__ updates for NumPy 1.17.0Stephan Hoyer2019-01-221-4/+1
| | | | | | | | | | - Always enable __array_function__ overrides. - Remove special cases for Python 2 compatibility. - Document these changes in 1.17.0-notes.rst. It will be good to see ASV numbers to understand the performance implications of these changes. If need be, we can speed up NumPy functions internally by using non-dispatched functions (with ``.__wrapped__``).
* TST, DOC: enable refguide_checkTyler Reddy2018-12-141-88/+82
| | | | | | | | * ported the refguide_check module from SciPy for usage in NumPy docstring execution/ verification; added the refguide_check run to Azure Mac OS CI * adjusted NumPy docstrings such that refguide_check passes
* MAINT: more fixes for disabling overridesStephan Hoyer2018-11-101-1/+4
|
* DEP: deprecate passing a generator to stack functionsStephan Hoyer2018-10-271-2/+3
| | | | | | Fixes gh-12263 We can't support generators with dispatch for ``__array_function__``.
* MAINT: set preferred __module__ for numpy functionsStephan Hoyer2018-10-231-1/+6
|
* ENH: __array_function__ support for np.lib, part 2/2 (#12119)Stephan Hoyer2018-10-221-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: __array_function__ support for np.lib, part 2 xref GH12028 np.lib.npyio through np.lib.ufunclike * Fix failures in numpy/core/tests/test_overrides.py * CLN: handle depreaction in dispatchers for np.lib.ufunclike * CLN: fewer dispatchers in lib.twodim_base * CLN: fewer dispatchers in lib.shape_base * CLN: more dispatcher consolidation * BUG: fix test failure * Use all method instead of function in assert_equal * DOC: indicate n is array_like in scimath.logn * MAINT: updates per review * MAINT: more conservative changes in assert_array_equal * MAINT: add back in comment * MAINT: casting tweaks in assert_array_equal * MAINT: fixes and tests for assert_array_equal on subclasses
* BUG: fix array_split incorrect behavior with array size bigger MAX_INT32 ↵Nikita Titov2018-08-261-2/+2
| | | | | | | | | | | | (#11813) Fixes #11809. * BUG: fix array_split incorrect behavior with array size bigger MAX_INT32 * TST: added test for array_split with array size greater MAX_INT32 * addressed review comments
* ENH: Make expand_dims work on subclassesEric Wieser2018-07-291-1/+5
| | | | This allows np.ma.expand_dims to be removed
* ENH: Add (put|take)_along_axis as described in #8708Eric Wieser2018-05-251-1/+226
| | | | This is the reduced version that does not allow any insertion of extra dimensions
* DOC: Add missing np. prefix to expand_dims docs (#10109)Hidehiro NAGAOKA2017-11-281-3/+3
|
* Merge pull request #9946 from eric-wieser/improve-take-docsAllan Haldane2017-11-281-5/+23
|\ | | | | DOC: describe the expansion of take and apply_along_axis in detail
| * DOC: describe the expansion of take and apply_along_axis in detailEric Wieser2017-11-211-5/+23
| | | | | | | | | | | | Extracted from gh-8714 [ci-skip]
* | DOC: v/h/dstack docstr shouldn't imply deprecationAllan Haldane2017-11-211-15/+11
|/ | | | [ci skip]
* Clarify docstring for numpy.array_splitDavid Linke2017-10-281-1/+7
| | | Before this addition, people could expect that only the last sub-array would have a different size. The added documentation and example make clear what the function really does.
* MAINT: Remove unused isscalar importEric Wieser2017-10-211-1/+1
|
* DOC: Fixed doctest of apply along axis with 3D returnMichael Seifert2017-09-061-2/+0
| | | | [skip ci]
* DEP: Deprecate incorrect behavior of expand_dims.Charles Harris2017-05-171-3/+18
| | | | | | | | | | | Expand_dims works as documented when the index of the inserted NewAxis in the resulting array satisfies -a.ndim - 1 <= index <= a.ndim. However, when index > a.ndim index is replaced by a.ndim and, when index < -a.ndim - 1, it is replaced by index + a.ndim + 1, which may be negative and results in incorrect placement. The latter two cases are now deprecated. Closes #9100.
* DOC: link to stack from column_stackEric Wieser2017-05-131-1/+1
| | | | [ci skip]