summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #7105 from seberg/writeable-as-stridedNathaniel J. Smith2016-02-131-0/+17
|\ \ \ | | | | | | | | DEP: Deprecate as_strided returning a writable array as default
| * | | DOC: Add documentation for as_stridedSebastian Berg2016-02-131-0/+17
| | | |
* | | | Added 'doane' and 'sqrt' estimators to np.histogram in numpy.function_baseJoseph Fox-Rabinovitz2016-02-111-29/+43
|/ / /
* | | Merge pull request #7181 from madphysicist/doc-typosCharles Harris2016-02-071-1/+2
|\ \ \ | | | | | | | | DOC: Updated minor typos in function_base.py and test_function_base.py
| * | | DOC: Updated minor typos in function_base.py and test_function_base.pyJoseph Fox-Rabinovitz2016-02-051-1/+2
| | | |
* | | | BUG: Fixed previous attempt to fix dimension mismatch in nanpercentileJoseph Fox-Rabinovitz2016-02-051-1/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | nanpercentile was conforming to dimension convention of percentile incorrectly. percentile outputs results for the different percentiles along the first dimension of the output. nanpercentile was moving the reduction axis to the front using swapaxes, which would move the first axis out of place if there were more than two in the array. Added a test with more than two axes to demonstrate and used rollaxis instead of swapaxes to do the interhange.
* | | ENH: usecols now accepts an int when only one column has to be readI--P2016-02-011-0/+38
| | |
* | | Merge pull request #7129 from madphysicist/percentile-midpoint-interpolationCharles Harris2016-01-311-1/+5
|\ \ \ | | | | | | | | BUG: Fixed 'midpoint' interpolation of np.percentile in odd cases.
| * | | BUG: Fixed 'midpoint' interpolation of np.percentile in odd cases.Joseph Fox-Rabinovitz2016-01-311-1/+5
| | | | | | | | | | | | | | | | | | | | 'midpoint' must return the same as 'higher' and 'lower' when the two are the same, not 'lower' + 0.5 as it was doing.
* | | | Merge pull request #7145 from bastula/piecewiseCharles Harris2016-01-311-0/+11
|\ \ \ \ | | | | | | | | | | BUG: Fixed regressions in np.piecewise in ref to #5737 and #5729.
| * | | | BUG: Fixed regressions in np.piecewise in ref to #5737 and #5729.Aditya Panchal2016-01-291-0/+11
| |/ / / | | | | | | | | | | | | Added unit tests for these conditions.
* | | | BUG: mode kwargs passed as unicode to np.pad raises an exceptionbertrand2016-01-301-0/+11
| | | | | | | | | | | | | | | | | | | | isinstance(mode, str) is False in python2.7 when mode is of unicode type, and mode is then mistakenly assumed to be a callable. See #7112
* | | | TST: Add missing suffix to temppath managerSebastian Berg2016-01-301-1/+1
|/ / / | | | | | | | | | | | | Without the suffix, np.save creates a new file and the file does not get cleaned up.
* | | TST: Added lots of new tests for fromnumeric.pygfyoung2016-01-181-32/+29
| | |
* | | Merge pull request #5981 from dfreese/fix/multi_percent_nanperc_bugJulian Taylor2016-01-171-1/+25
|\ \ \ | | | | | | | | BUG: Handle multiple percentiles for all-nan slices in nanpercentile
| * | | BUG: Fix nanpercentile crash on all-nan slicesDavid Freese2016-01-121-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bug where nanpercentile would crash with an all-nan slices when given multiple percentiles. Also corrects behavior where array sizes different from numpy.percentile would be returned with keepdims enabled. Fix #5760
* | | | Merge pull request #7020 from jakirkham/deprecated_masked_array_mask_copyCharles Harris2016-01-151-0/+1
|\ \ \ \ | | | | | | | | | | DEP: Warn MaskedArray will return views of mask when sliced
| * | | | TEST: Ignore `FutureWarning` if raised from running masked array operations.John Kirkham2016-01-151-0/+1
| |/ / /
* | | | DOC, MAINT: Enforce np.ndarray arg for np.put and np.placegfyoung2016-01-142-4/+4
|/ / / | | | | | | | | | | | | | | | | | | np.put and np.place do something only when the first argument is an instance of np.ndarray. These changes will cause a TypeError to be thrown in either function should that requirement not be satisfied.
* | | MAINT: Simplify some tests using temppath context manager.Charles Harris2015-12-261-55/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces code of the pattern ``` fd, name = tempfile.mkstemp(...) os.close(fd) try: do stuff with name finally: os.remove(name) ``` with ``` with temppath() as name: do stuff with name ``` A few more complicated cases are also handled. The remains some particularly gnarly code the could probably be refactored to use temppath, but that is a more demanding project.
* | | Merge pull request #6866 from charris/tempfile-context-managerCharles Harris2015-12-201-21/+12
|\ \ \ | | | | | | | | ENH: Tempfile context manager
| * | | MAINT: Use temppath in test_not_closing_opened_fid.Charles Harris2015-12-201-21/+12
| | | | | | | | | | | | | | | | | | | | The test is in numpy/lib/tests/test_io.py. This commit is intended as a demonstration of using temppath.
* | | | DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-1/+1
|/ / / | | | | | | | | | Closes gh-6863.
* | | Merge pull request #6808 from charris/fix-assert-in-testsJaime2015-12-111-3/+3
|\ \ \ | | | | | | | | MAINT: Replace assert with assert_(...) in some tests.
| * | | MAINT: Replace assert with assert_(...) in some tests.Charles Harris2015-12-101-3/+3
| | | |
* | | | [TST] fix test_dtype_error to actually test what it's supposed toNathaniel J. Smith2015-12-081-3/+3
|/ / / | | | | | | | | | | | | Discovered while cleaning up uses of the silly aliases like 'np.object'.
* | | Merge pull request #6775 from charris/add-future-importsCharles Harris2015-12-071-1/+2
|\ \ \ | | | | | | | | MAINT: Include from __future__ boilerplate in some files missing it.
| * | | MAINT: Include from __future__ boilerplate in some files missing it.Charles Harris2015-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | Some newer *.py files are missing the `from __future__` boilerplate that helps assure Python2 and Python3 compatibility.
* | | | BUG: Quick and dirty fix for interp.Charles Harris2015-12-071-4/+36
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original had incorrect comparisons involving <=, <, and also failed when the number of data points was 2. This fixes the use of the comparisons and uses linear search for fewer than 5 data points. The whole routine needs a simplified rewrite, but this takes care of the bug. Closes #6468.
* | | Merge pull request #6690 from lzkelley/hist_check_range_finiteJaime2015-11-171-0/+17
|\ \ \ | | | | | | | | BUG, MAINT: check that histogram range parameters are finite.
| * | | BUG, MAINT: check that histogram range parameters are finite, add tests to ↵lzkelley2015-11-171-0/+17
| | | | | | | | | | | | | | | | assure this. Improved some error-types.
* | | | ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-162-7/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | * 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
* | | 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.
* | | TST: attempt to make test_load_refcount deterministicNathaniel J. Smith2015-10-281-6/+11
| | | | | | | | | | | | | | | | | | Use a different strategy to detect whether np.load creates cycles. Fixes gh-6571, I hope.
* | | Merge pull request #6562 from ahaldane/disable_view_safety_checksCharles Harris2015-10-261-10/+0
|\ \ \ | | | | | | | | Disable view safety checks
| * | | TST: Remove tests of view safety checks (see next commit)Allan Haldane2015-10-261-10/+0
| | | | | | | | | | | | | | | | | | | | Remove unit tests for the view safety chekcs, which are to be reverted in the next commit.
* | | | BUG: error in broadcast_arrays with as_strided arrayStephan Hoyer2015-10-241-0/+8
|/ / / | | | | | | | | | Fixes GH6491
* | | BUG: Make median work for empty arrays (issue #6462)Ethan Kruse2015-10-211-0/+28
| | | | | | | | | | | | | | | np.median([]) returns NaN. Fixes bug/regression that raised an IndexError. Added tests to ensure continued support of empty arrays.
* | | TST: new np.corrcoef improved stabilityLars Buitinck2015-10-051-0/+6
| | |
* | | 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
| | | |
* | | | TST: Update test__version.py.Charles Harris2015-09-231-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added tests for the x.x.dev0+1234567 form together with alpha and beta versions of same. Updates lifted from scipy.
* | | | Merge pull request #6271 from charris/change-deprecated-indexes-to-errorCharles Harris2015-09-101-6/+12
|\ \ \ \ | | | | | | | | | | DEP,MAINT: Change deprecated indexing to errors.
| * | | | DEP,MAINT: Change deprecated indexing to errors.Charles Harris2015-09-061-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The deprecated operations changed to errors are * Conversion of floats and booleans to npy_intp indexes. * Conversion of single element integer arrays of ndim > 1 to indexes. * Multiple ellipsis in index. The affected deprecation tests have been been changed to check for raised errors instead, but remain in test_deprecations.py for the moment. They will be moved when the conversion of the remaining indexing deprecations is complete.
* | | | | possibility to calculate gradient over specific axes instead of all axesMaximilian Trescher2015-09-031-0/+25
|/ / / / | | | | | | | | | | | | when given axis=None, behave the same as axis not being provided
* | | | Auto merge of #6206 - jaimefrio:searchsorted_ndarray, r=njsmithHomu2015-08-171-0/+9
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | MANT: searchsorted should return base ndarrays always
| * | | | MANT: searchsorted should return base ndarrays alwaysJaime Fernandez2015-08-161-0/+9
| | | | |
* | | | | ENH: Adding in automatic number of bins estimation for np.histogram. Users ↵Varun Nayyar2015-08-151-0/+90
|/ / / / | | | | | | | | | | | | can now pass in bins='auto' (or 'scott','fd','rice','sturges') and get the corresponding rule of thumb estimator provide a decent estimate of the optimal number of bins for the given the data.
* | | | Clarify signature of numpy.pad.Antony Lee2015-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | `mode` is a required argument so just declare it as such. This does not prevent it from being passed as a keyword argument.
* | | | BUG: fixed regression in np.histogram which caused input floating-point ↵Thomas Robitaille2015-07-271-0/+7
| | | | | | | | | | | | | | | | values to be modified