summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_shape_base.py
Commit message (Collapse)AuthorAgeFilesLines
* DEP: Finalize the non-sequence stacking deprecationSebastian Berg2023-01-171-2/+2
| | | | | | | | | 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.
* TST: add functional tests for kronShreyas Joshi2022-09-211-0/+29
|
* TST: `np.kron` tests refinementGanesh Kathiresan2022-04-051-7/+17
| | | | | | | * Added `mat` cases to smoke tests * Changed type checks to handle new change which uses ufuncs order for result determination * Added cases for `ma` to check subclass info retention
* MAINT: Linting fixesGanesh Kathiresan2022-03-251-1/+2
|
* TST: Added testcases for `np.kron`Ganesh Kathiresan2022-03-221-0/+26
| | | | | | * Smoke tests to ensure `np.kron` works. * Shape tests to check if `np.kron` computes the right shape for different edge cases of input arrays
* MAINT: refactor "for ... in range(len(" statementsMike Taves2021-09-011-3/+7
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-16/+16
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* 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.
* MAINT: lib: Clean up in tests.Warren Weckesser2020-01-011-1/+0
| | | | * Remove a few unused imports in several files.
* ENH,DEP: Allow multiple axes in expand_dims (#14051)Larry Bradley2019-12-021-6/+18
| | | | | | | | | 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.
* Use set litteralsRoman Yurchak2018-11-241-2/+2
|
* DEP: deprecate passing a generator to stack functionsStephan Hoyer2018-10-271-0/+9
| | | | | | Fixes gh-12263 We can't support generators with dispatch for ``__array_function__``.
* TST: unit tests for column_stack.Tyler Reddy2018-10-191-0/+20
|
* BUG: fix array_split incorrect behavior with array size bigger MAX_INT32 ↵Nikita Titov2018-08-261-0/+14
| | | | | | | | | | | | (#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
* TST: Add tests for expand_dimsEric Wieser2018-07-301-0/+9
|
* ENH: Add (put|take)_along_axis as described in #8708Eric Wieser2018-05-251-1/+91
| | | | This is the reduced version that does not allow any insertion of extra dimensions
* Merge pull request #11010 from mhvk/poly-matrix-tests-to-matrixlibCharles Harris2018-05-151-13/+9
|\ | | | | Move remaining Matrix tests to matrixlib
| * MAINT: move matrix tests in lib to matrixlib.Marten van Kerkwijk2018-04-291-13/+9
| |
* | MAINT: Misc. typos (#11005)luzpaz2018-04-301-2/+2
|/ | | | | | | | | User- and non-user-facing typos. Some source typos fixes as well. Found via `codespell`.
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-6/+1
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* MAINT: Remove `level=` keyword from test arguments.Charles Harris2017-08-051-1/+1
| | | | | | I don't know what that argument was used for, but it showis up in old tests and is not explicitly used within the tests. I assume it was part of an old testing framework and is now longer needed.
* TST: Remove unittest dependencies in numpy/lib/tests.Charles Harris2017-07-241-25/+25
|
* DEP: Deprecate incorrect behavior of expand_dims.Charles Harris2017-05-171-1/+22
| | | | | | | | | | | 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.
* BUG: Fix double-wrapping of object scalarsEric Wieser2017-04-061-0/+15
| | | | Fixes #8642
* BUG: Don't leak internal exceptions when given an empty arrayEric Wieser2017-02-131-0/+19
| | | | Fixes #7454
* TST: Verify apply_along_axis now works on masked arraysEric Wieser2017-02-111-0/+14
| | | | | Note that this is not a full subsitute for np.ma.apply_along_axis, as that allows functions to return a mix of np.ma.masked and scalars
* BUG: Work around evil matrix.__array_prepare__Eric Wieser2017-02-111-3/+9
|
* BUG: Fix crash on 0d return value in apply_along_axisEric Wieser2017-02-111-6/+62
| | | | | | Also: ENH: Support arbitrary dimensionality of return value MAINT: remove special casing
* BUG: Fix apply_along_axis() for when func1d() returns a non-ndarray (#8426)Ben Rowland2016-12-311-0/+6
| | | | | | | | | | | | * BUG: Closes issue #8419 Fixes issue in apply_along_axis() where func1d() returns a non ndarray * BUG: Fix apply_along_axis() when func1d() returns a non-ndarray Closes issue #8419. Fixes issue in apply_along_axis() where func1d() returns a non ndarray by calling asanyarray() on result. This commit fixes a too long line in the test case.
* ENH: allow numpy.apply_along_axis() to work with ndarray subclasses (#7918)Ben Rowland2016-10-111-0/+31
| | | | | | | This commit modifies the numpy.apply_along_axis() function so that if it is called with an ndarray subclass, the internal func1d calls receive subclass instances and the overall function returns an instance of the subclass. There are two new tests for these two behaviours.
* TST: Fix #6542: Add tests for non-iterable input...gkBCCN2016-02-291-1/+28
| | | | | | ...to hstack, vstack, stack, hsplit, vsplit, dsplit, dstack that check that they raise exceptions.
* DEP: Remove FutureWarning from np.lib.split and go to future.Charles Harris2015-10-301-18/+12
| | | | | | | | | | | | | | | Previously an empty array resulting from split always had dimension 1-D. In Numpy 1.9 a FutureWarning was raised to notify users that it was planned to preserve the dimensions of empty arrays in a future numpy release. This removes the FutureWarning and implements preservation of dimensions. Note that there was a bug in numpy 1.9 and the dimensions of empty arrays was already preserved in some cases and no warning was issued. This PR fixes that inconsistency by preserving the dimensions in all cases rather than fixing the bug, as the dimension preserving behavior was already depended on by some users. See the discussion in gh-6575 about this change.
* Merge pull request #6371 from seberg/pr-5771Charles Harris2015-09-271-0/+9
|\ | | | | BUG: Make sure warning for array split is always applied
| * TST: Test empty warning for split with manual inputsSebastian Berg2015-09-271-0/+9
| |
* | BUG: Fix tiling of zero-sized arrays numpy/numpy#6089 and add test case.Dimas Abreu Dutra2015-07-171-0/+3
|/
* BUG: Fixed issue #4679 and added testOliver Eberle2015-02-191-0/+6
| | | | | Tile now copies the input when it is a numpy array and all dimensions are repeated only once.
* MAINT: Fix problems noted by pyflakes in numpy/lib/tests.Charles Harris2014-07-311-135/+142
|
* BUG: Fix array_split empty array type and add FutureWarningSebastian Berg2013-12-201-2/+8
| | | | | | | | | | | | | | | | | Fixes the result type of empty output arrays. The FutureWarning warns about changed behaviour. A "kludge" was introduced into array split converting converting the result of something like: >>> np.array_split(np.array([[1, 1]]), 2) [array([[1, 1]]), array([], dtype=int64)] instead of retaining the shape of the empty/second array to be (0, 2). A FutureWarning is now raised when such a replacement occurs. Closes gh-612
* STY: Make numpy/lib/test/*.py PEP8 compliant.Charles Harris2013-09-031-33/+48
| | | | | | | Run autopep8 over the test files in numpy/lib/test and make fixes to the result. Also remove Python5 workaround.
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-165/+165
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* ENH: implement may_share_memory in CJulian Taylor2013-05-281-0/+15
| | | | | | | | | memmap needs to call it in __array_finalize__ to determine if it can drop the references on copies. The python version if may_share_memory caused significant slowdowns when slicing these maps. closes gh-3364
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* BUG: Some bugs in squeeze and concatenate found by testing SciPyMark Wiebe2011-08-271-0/+7
|
* STY: Replace assert by assert_ in tests. There remain 124 uses ofCharles Harris2011-04-051-5/+5
| | | | assert in non-testing files that should be checked for correctness.
* All non core regressions tests moved to their respective modules.David Cournapeau2009-09-161-139/+0
|
* Move matrix class into its own module.David Cournapeau2009-09-161-0/+1
|
* ran reindentJarrod Millman2008-08-081-1/+1
|
* Added tests to improve coverage.Alan McIntyre2008-07-131-0/+7
| | | | Renamed TestPiecewise methods so that they will be picked up by nose.