summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #9524 from charris/add_init_to_test_directoriesCharles Harris2017-08-121-0/+0
|\ | | | | TST, MAINT: Add `__init__.py` files to tests directories.
| * TST, MAINT: Add `__init__.py` files to tests directories.Charles Harris2017-08-061-0/+0
| | | | | | | | | | | | | | | | This allows pytest to run with duplicate test file names. Note that `python <path-to-test-file>` no longer works with this change, nor will a simple `pytest numpy`, because numpy is imported from the numpy repository. However, `python runtests.py` and `>>> numpy.test()` are still available.
* | MAINT: Use moveaxis instead of rollaxis internally (#9475)Nico Schlömer2017-08-104-11/+11
|/ | | | | Also add a hint to the documentation advising the use of moveaxis over rollaxis. Tests for rollaxis are left alone.
* Merge pull request #9522 from eric-wieser/stop-using-obj2sctypeCharles Harris2017-08-062-3/+8
|\ | | | | BUG: Fix problems with obj2sctype
| * BUG: Don't allow an array to be passed as the dtype argumentEric Wieser2017-08-062-3/+8
| |
* | Merge pull request #9505 from eric-wieser/fix-issubdtypeCharles Harris2017-08-064-7/+7
|\ \ | |/ |/| BUG: issubdtype is inconsistent on types and dtypes
| * MAINT: Stop using the undocumented coercion-then-downcast feature of subdtypeEric Wieser2017-08-054-7/+7
| |
* | MAINT: Remove `level=` keyword from test arguments.Charles Harris2017-08-052-19/+17
|/ | | | | | 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.
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-0510-57/+57
| | | | | | | 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
* MAINT: Changed diff to use iterative instead of recursive approachJoseph Fox-Rabinovitz2017-07-312-23/+84
| | | | | | | | | | | | | TST: Added tests for `n` parameter Added test for `datetime64` type change Added tests for axis normalization Added test for subtype handling DOC: Minor updates to docs: Added explanation for `n==0` Added documentation describing `datetime64` handling Updated formatting Added call to normalize_axis_index
* MAINT: Make `setxor1d' a bit clearer and speed it upwufangjie2017-07-281-5/+1
|
* make `setxor1d' a bit clear and speed upwufangjie2017-07-271-2/+3
| | | We need to find the index which is not the same with the left and right, I think np.logical_and's meaning is more clear and I test this got a speed up
* Merge pull request #9434 from charris/remove-unittest-dependenciesCharles Harris2017-07-2417-328/+327
|\ | | | | Remove unittest dependencies
| * TST: Remove unittest dependencies in numpy/lib/tests.Charles Harris2017-07-2417-328/+327
| |
* | MAINT: Use dtypes, not typecodes, and remove special casing for timedeltaEric Wieser2017-07-131-27/+21
| |
* | BUG: float16 is promoted to float64 by gradientEric Wieser2017-07-132-1/+7
|/ | | | This isn't the case for `diff`
* Merge pull request #9362 from charris/rearrange-testing-moduleCharles Harris2017-07-063-5/+3
|\ | | | | ENH: Rearrange testing module to isolate nose dependency.
| * MAINT: Rearrange files in numpy/testing module.Charles Harris2017-07-043-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim here is to separate out the nose dependent files prior to adding pytest support. This could be done by adding new files to the general numpy/testing directory, but I felt that it was to have the relevant files separated out as it makes it easier to completely remove nose dependencies when needed. Many places were accessing submodules in numpy/testing directly, and in some cases incorrectly. That presented a backwards compatibility problem. The solution adapted here is to have "dummy" files whose contents will depend on whether of not pytest is active. That way the module looks the same as before from the outside. In the case of numpy itself, direct accesses have been fixed. Having proper `__all__` lists in the submodules helped in that.
* | DOC: Add examples for complex dtypesEric Wieser2017-07-031-13/+16
| | | | | | | | | | | | Also remove redundancy between the function and return value descriptions [ci skip]
* | Merge pull request #9343 from eric-wieser/recfunction-join-dtypeAllan Haldane2017-07-012-65/+189
|\ \ | | | | | | BUG: recfunctions fail in a bunch of ways due to using .descr
| * | MAINT: Avoid one more use of descrEric Wieser2017-07-011-11/+6
| | |
| * | MAINT: remove tuple<->list conversion danceEric Wieser2017-07-011-30/+31
| | |
| * | TST: join_by now works for dtypes with padding tooEric Wieser2017-07-011-0/+16
| | | | | | | | | | | | Once again, thanks to not using .descr
| * | MAINT: Shortcut for flat dtypes wasn't used for scalar dtypesEric Wieser2017-07-011-3/+3
| | |
| * | BUG: flatten_descr returns string not dtype for scalar dtypeEric Wieser2017-07-011-1/+1
| | |
| * | MAINT: Stop using .descr in recfunctionsEric Wieser2017-07-011-18/+22
| | | | | | | | | | | | This change shouldn't affect behaviour - all old uses were still correct.
| * | TST: Add failing test for mismatch of key typeEric Wieser2017-07-011-1/+16
| | |
| * | BUG: stack_arrays fails for subdtypesEric Wieser2017-07-012-5/+34
| | | | | | | | | | | | Again, fixed by not using descr
| * | BUG: recfunctions.join_by fails when key is a subdtypeEric Wieser2017-07-012-11/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that working with .descr is a generally terrible idea. Instead we introduce `get_fieldspec`, which returns a list of 2-tuples, encapsulating subdtypes. This also means that np.core.test_rational.rational survives a roundtrip - its .descr is 'V8', which ddoesn't survive
| * | BUG: recfunctions.join_by fails for colliding values with different dtypesEric Wieser2017-07-012-11/+25
| | | | | | | | | | | | Fixes #9338
| * | MAINT: use set operators for brevityEric Wieser2017-07-011-3/+3
| |/
* | DOC: Improve documentation of common_type (#9344)Gunjan2017-07-011-2/+2
|/ | | Fixes gh-9326
* TST: Verify that join_by doesn't choke on subdtypesEric Wieser2017-06-271-0/+10
|
* MAINT: Fix alerts from http://lgtm.com (#9292)Jean Helie2017-06-261-1/+1
| | | | | | | * make exception raising 2/3 compatible * remove unnecesary else statement after while loop without break clause * ensure file is always enclosed even in the event of an exception * ensure list comprehension variable does not override enclosing loop variable
* Merge pull request #9220 from eric-wieser/simplify-nanfuncsCharles Harris2017-06-221-43/+53
|\ | | | | MAINT: Factor out code duplicated by nanmedian and nanpercentile
| * MAINT: Factor out code duplicated by nanmedian and nanpercentileEric Wieser2017-06-211-43/+53
| |
* | MAINT: Use neq instead of xor in diffEgor Panfilov2017-06-171-1/+1
| |
* | BUG: Switched to xor for bool arrays in diff, added corresponding testsEgor Panfilov2017-06-172-6/+20
| |
* | DOC: BLD: fix lots of Sphinx warnings/errors.Ralf Gommers2017-06-102-2/+2
|/
* Merge pull request #9214 from eric-wieser/no-one-arg-whereCharles Harris2017-06-033-6/+7
|\ | | | | MAINT: Don't internally use the one-argument where
| * MAINT: Don't internally use the one-argument whereEric Wieser2017-06-033-6/+7
| | | | | | | | nonzero is a clearer spelling
* | BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-037-10/+10
|/ | | | Bare except is very rarely the right thing
* Merge pull request #9212 from eric-wieser/tidy-function_baseJulian Taylor2017-06-032-9/+4
|\ | | | | MAINT: Combine similar branches
| * MAINT: Combine similar branchesEric Wieser2017-06-032-9/+4
| |
* | MAINT: Use np.concatenate instead of np.vstack (#8934)Joseph Paul Cohen2017-06-021-12/+4
|/ | | | | | | | | | | | | | The np.vstack function is maintained for backward compatibility, it's use in new code is discouraged. * MAINT: Replace internal uses of vstack vstack is supported only for backward compatibility We should use concatenate or stack instead * MAINT: Remove 1d special casing in piecewise * STY: Fix missing blank line in ma.tests.test_extras.py
* BUG: have as_strided() keep custom dtypesAntoine Pitrou2017-05-242-4/+11
| | | | Fixes issue #9161
* BUG: set default type for empty index array to `numpy.intp` (#9142)Konrad Kapp2017-05-202-2/+12
| | | | Fixes #9137
* DEP: Deprecate incorrect behavior of expand_dims.Charles Harris2017-05-172-4/+40
| | | | | | | | | | | 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]
* Merge pull request #9070 from ahaldane/silence_join_byEric Wieser2017-05-102-6/+49
|\ | | | | BUG: Preserve field order in join_by, avoids FutureWarning