summaryrefslogtreecommitdiff
path: root/numpy/linalg/tests/test_linalg.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'master' into linalg-move-matrix-powerCharles Harris2018-05-141-178/+231
|\
| * MAINT: move linalg tests using matrix to matrixlibMarten van Kerkwijk2018-04-271-179/+232
| | | | | | | | | | This is in preparation for deprecation and eventual removal of the matrix class.
* | ENH: Allow stacks of matrices in matrix_power.Marten van Kerkwijk2018-04-291-11/+20
|/ | | | | Since linalg allows stacks of matrices generally, there is no reason not to allow it for matrix_power.
* 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.
* TST: Switch to using pytest markersCharles Harris2018-04-041-8/+9
| | | | | | | | | | | Use standard pytest markers everywhere in the numpy tests. At this point there should be no nose dependency. However, nose is required to test the legacy decorators if so desired. At this point, numpy test cannot be run in the way with runtests, rather installed numpy can be tested with `pytest --pyargs numpy` as long as that is not run from the repo. Run it from the tools directory or some such.
* BUG: linalg: fix corner-case behavior of cond() + use SVD if possiblePauli Virtanen2018-02-121-27/+94
| | | | | | | | | | | | | Make np.linalg.cond(A, p) always use SVD for p=+-2 and not only p=None. Ensure inf is returned instead of nan when the condition number diverges for +/-2 norm. Ignore errors when inverting matrices for p = +-1, 'fro', +-inf, so that spurious LinAlgErrors are not raised. In those cases, report non-invertible matrices as having cond=inf. Add additional tests for cond().
* MAINT: repair deprecated yield testsxoviat2017-12-231-26/+26
|
* TST: linalg: add basic smoketest for choleskyPauli Virtanen2017-09-301-0/+24
|
* ENH: add hermitian=False kwarg to matrix_powerCJ Carey2017-09-161-0/+13
| | | | | With a symmetric matrix, the more efficient `eigvalsh` method can be used to find singular values.
* BUG: Fix pinv on matrix stacksEric Wieser2017-09-121-2/+6
| | | | Fixes #8826
* ENH: Warn to change lstsq default for rcondSebastian Berg2017-08-191-1/+18
| | | | | The default parameter used by LAPACK (which was our default) is not very good, so implement a FutureWarning to change to a better default.
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-051-1/+1
| | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-031-1/+1
| | | | Bare except is very rarely the right thing
* MAINT: Remove python side empty array handling from linalgSebastian Berg2017-04-291-1/+140
| | | | | | | | | The necessary fixup on the C-side of linalg has been done already (i.e. the gufuncs correctly work for these empty arrays). This also enables cholesky decomposition and fixes a small bug in pinv handling. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* Merge pull request #8682 from eric-wieser/stack-matrix_rankCharles Harris2017-04-121-2/+3
|\ | | | | ENH: allow argument to matrix_rank to be stacked
| * ENH: allow argument to matrix_rank to be stackedEric Wieser2017-02-241-2/+3
| | | | | | | | Fixes #5905
* | ENH: Implement most linalg operations for 0x0 matricesEric Wieser2017-03-041-20/+5
| | | | | | | | | | | | | | | | | | | | Fixes #8212 det: return ones of the right shape slogdet: return sign=ones, log=zeros of the right shape pinv, eigvals(h?), eig(h?): return empty array(s?) of the right shape svd & qr: not implemented, due to complex return value rules
* | MAINT: replace len(x.shape) with x.ndimEric Wieser2017-02-241-1/+1
|/
* Merge pull request #8584 from eric-wieser/resolve_axisMarten van Kerkwijk2017-02-211-2/+2
|\ | | | | MAINT: Use the same exception for all bad axis requests
| * MAINT: Be specific about where AxisError is raisedEric Wieser2017-02-201-2/+2
| | | | | | | | These were tested by temporarily removing the base classes from AxisError
| * MAINT: Use normalize_axis_index in all python axis checkingEric Wieser2017-02-201-2/+2
| | | | | | | | | | | | | | As a result, some exceptions change from ValueError to IndexError This also changes the exception types raised in places where normalize_axis_index is not quite appropriate
* | fixup! TST: Refactor all the test case listsEric Wieser2017-02-091-89/+77
| |
* | TST: Correct test cases to actually make senseEric Wieser2016-12-191-5/+5
| | | | | | | | | | | | These testcases were never used in the first place, due to a typo. This makes their dimensions match the order of the other test cases, even though those also did not run
* | TST: Refactor all the test case listsEric Wieser2016-12-191-77/+176
| | | | | | | | | | Allows each individual function to inspect the flags of a certain test, and decide whether an exception will be thrown
* | TST: Adjust the precision of assert_almost_equal, but based on the typeEric Wieser2016-12-191-8/+11
| | | | | | | | | | SVD was previously being too generous with accuracy on doubles. This allows pinv, the test for which was previously was too imprecise, to pass.
* | TST: Enable testing pinv on non-square matricesEric Wieser2016-12-191-1/+1
| |
* | TST: Prevent non-square testcases being hidden by square ones (fix typo)Eric Wieser2016-12-191-1/+1
| |
* | TST: Correct pinv test case such that it doesn't fail correct casesEric Wieser2016-12-191-1/+1
| |
* | TST: Add some non-square 0-shaped test-casesEric Wieser2016-12-191-0/+6
| |
* | TST: Correct empty square test case to actually be squareEric Wieser2016-12-191-3/+3
|/ | | | atleast_2d(array([], dtype=double)) returns an array of shape (1, 0), not (0, 0)
* TST: Use new warnings context manager in all testsSebastian Berg2016-09-021-5/+5
| | | | | | | | In some places, just remove aparently unnecessary filters. After this, all cases of ignore filters should be removed from the tests, making testing (even multiple runs) normally fully predictable.
* BUG: fix float16 type not being called due to wrong orderingJulian Taylor2016-08-051-2/+2
| | | | closes gh-7897
* BUG: Make sure that the `ord=0` case returns a float.John Kirkham2016-01-221-4/+1
|
* TST: Verify that `norm` is properly casting values to floats as needed.John Kirkham2016-01-221-0/+96
|
* MAINT: Replace assert with assert_(...) in some tests.Charles Harris2015-12-101-2/+2
|
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-161-2/+1
| | | | | | | | * use SkipTest in numpy tests instead of importing it from nose * add a KnownFailureException as an alias for KnownFailureTest (the former is preferred, but the latter is kept for backcompat) * rename the KnownFailure nose plugin into KnownFailurePlugin, and keep the old name for backcompat
* BUG,ENH: allow linalg.cond to work on a stack of matricesSebastian Berg2015-09-251-2/+12
| | | | | | | This was buggy, because the underlying functions supported it partially but cond was not aware of this. Closes gh-6351
* STY: PEP8 and pyflakes fixes for numpy/linalg/tests.Charles Harris2015-07-251-76/+116
|
* MAINT: eigenvalues returned by eigh are ascendingalex2015-06-221-13/+11
|
* MAINT: notice that eigvalsh returns a sorted arrayalex2015-06-191-7/+3
|
* TST: Make the test for linalg matrix norms coverage completeRittaNarita2015-03-301-20/+23
|
* ENH: nuclear normalex2014-12-251-5/+24
|
* BUG: Xerbla doesn't get linked in 1.10-devel.Charles Harris2014-12-241-3/+6
| | | | | | | | | | | Add our python_xerbla to the multiarray sources. That function is needed for all modules that link to the ATLAS 3.10 libraries, which are now all located in two files, libsatlas and libtatlas. Also make the test for xerbla linkage work better. If xerbla is not linked the test will be skipped with a message. Closes #5362.
* ENH: add `multi_dot`: dot with multiple arguments.Stefan Otte2014-11-101-2/+88
| | | | | | | | | | | `np.linalg.multi_dot` computes the dot product of two or more arrays in a single function call, while automatically selecting the fastest evaluation order. The algorithm for selecting the fastest evaluation order uses dynamic programming and closely follows: Cormen, "Introduction to Algorithms", Chapter 15.2, p. 370-378
* MAINT: Stop repeatedly running duplicate tests.Eric Moore2014-10-171-0/+1
| | | | | | These three tests don't make use of the infrastructre in _TestNorm. This means they are identical tests when run as part of TestNorm(Double,Single,Int64). Once is enough.
* ENH: Add keepdims to linalg.normEric Moore2014-10-171-0/+42
|
* MAINT: linalg: prune unused routines from lapack_litePauli Virtanen2014-01-121-5/+5
|
* BUG: fix complex norm of higher orderJulian Taylor2014-01-021-0/+12
| | | | | | asfarray truncates the complex part, so it must be avoided for complex types. Closes gh-4156.
* BUG: linalg: norm fails on longdouble, signed intLars Buitinck2013-12-261-0/+12
| | | | | | | | | | | | | | | | | | | | | This fixes the following bug with longdouble: >>> x = np.arange(10, dtype=np.longdouble) >>> np.linalg.norm(x, ord=3) Traceback (most recent call last): File "<ipython-input-5-7ee53a8ac142>", line 1, in <module> np.linalg.norm(x, ord=3) File "/tmp/v/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 2090, in norm return add.reduce(absx**ord, axis=axis)**(1.0/ord) UnboundLocalError: local variable 'absx' referenced before assignment As well as the handling of minimal values for signed integers: >>> x = np.array([-2**31], dtype=np.int32) >>> np.linalg.norm(x, ord=3) /tmp/v/lib/python2.7/site-packages/numpy/linalg/linalg.py:2090: RuntimeWarning: invalid value encountered in double_scalars return add.reduce(absx**ord, axis=axis)**(1.0/ord) nan
* MAINT: Refactor eigh and eigvalsh and associated tests.Charles Harris2013-10-261-41/+50
| | | | | | Do not convert the UPLO argument to a bytestring, it is not necessary. Distribute parts of the eigh tests into the appropriate TestEigvalsh or TestEigh test class.