summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #5805 from jaimefrio/ix_intpCharles Harris2015-05-051-1/+29
|\ \ | | | | | | Ix intp
| * | BUG: Fix handling of non-empty ndarraysJaime Fernandez2015-05-041-8/+12
| | |
| * | TST: Added tests for ix_Jaime Fernandez2015-04-271-1/+25
| | |
* | | BUG: fixes segfault in np.place when vals is emptybehzad nouri2015-05-041-0/+8
|/ /
* | Merge pull request #4612 from Nodd/loadtxt_commentsCharles Harris2015-04-231-3/+37
|\ \ | | | | | | ENH: Multiple comment tokens in loadtxt
| * | ENH: Multiple comment tokens in loadtxtJoseph Martinot-Lagarde2015-04-221-3/+37
| | |
* | | ENH: add options for disabling use of pickle in load/savePauli Virtanen2015-04-181-0/+16
| |/ |/|
* | Merge pull request #5713 from cowlicks/bug-5712Charles Harris2015-04-051-0/+44
|\ \ | | | | | | Fix read_array_header_*
| * | TST: tests for format.read_array_header_* and test read_magicBlake Griffith2015-04-011-0/+44
| |/
* | TST: Test nan_to_num with integer list input.Charles Harris2015-04-031-0/+2
|/
* ENH: deprecate bias and ddof arguments to corrcoefMatthew Brett2015-03-151-10/+28
| | | | | | | The bias and ddof arguments had no effect on the calculation of the correlation coefficient because the value cancels in the calculation. Deprecate these arguments to np.corrcoef and np.ma.corrcoef.
* Merge pull request #5585 from Kreiswolke/BugFixTileJaime2015-03-121-0/+6
|\ | | | | BUG: Fixed issue #4679 - make numpy.tile always return a copy
| * 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.
* | Merge pull request #5519 from jaimefrio/array_interface_dtypeCharles Harris2015-03-121-0/+23
|\ \ | | | | | | ENH: PyArray_FromInterface checks descr if typestr is np.void
| * | ENH: PyArray_FromInterface checks descr if typestr is np.voidjaimefrio2015-03-081-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the 'typestr' member of the __array_interface__ dictionary defines a np.void dtype, check the 'descr' member, and if it is a valid dtype description and it is not the default one, use it to construct the dtype for the array to return. This fixes #5081, as as_strided no longer has to worry about changing the dtype of the return.
* | | BUG: loadtxt fails with complex data in Python 3.Charles Harris2015-03-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the Python complex type constructor only accepts a pair of numbers or a string, unlike other numeric types it does not work with byte strings. The numpy error is subtle, as loadtxt opens the file in the default text mode, but then converts the input lines to byte strings when they are split into separate values. The fix here is to convert the values back to strings in the complex converter. Closes #5655.
* | | STY: fold long linesPauli Virtanen2015-03-081-2/+2
| | |
* | | BUG: enable working around pickle compatibility issues on Py3 in npy filesPauli Virtanen2015-03-085-1/+66
| | | | | | | | | | | | | | | | | | Add pickle compatibility flags to numpy.save and numpy.load. Allow only combinations that cannot corrupt binary data in Numpy arrays. Use the same default values as Python pickle.
* | | BUG: genfromtxt gave OverflorError for large integersThomas Robitaille2015-03-062-4/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix StringConverter to avoid OverflowError in genfromtxt. Before, int(2**66) would work (and return a ‘long’) but then np.array([2**66], dtype=np.integer) would not work and return an OverflowError which would propagate to genfromtxt. This commit fixes this by ensuring testing in advance whether an OverflowError will occur. In addition, this adds an explicit np.int64 entry on systems where integer means int32. Values larger than 2**63-1 will be cast as float. This includes a regression test and adds an entry to the release notes.
* | | BUG: fix broadcast_to for reference typesStephan Hoyer2015-03-011-0/+10
| | |
* | | BLD: Add mingw-w64 support for the mingw64static option.carlkl2015-02-271-1/+1
|/ /
* | ENH: add broadcast_to functionStephan Hoyer2015-02-261-2/+88
|/ | | | | | | | Per the mailing list discussion [1], I have implemented a new function `broadcast_to` that broadcasts an array to a given shape according to numpy's broadcasting rules. [1] http://mail.scipy.org/pipermail/numpy-discussion/2014-December/071796.html
* MAINT: Fix pmt test in numpy/lib/tests/test_financial.py.Charles Harris2015-02-171-24/+22
| | | | | | | The tests were using assert_almost_equal and setting the precision to 3 decimals. The reason for that low precision appears to have been the failure of the tests for a more reasonable precision. The fix was to use assert_allclose instead.
* BUG: Fix zero divide warning in financial.pmt.Fei Liu2015-02-171-0/+5
| | | | | | | | | The pmt function in financial.py does a zero divide when rate=0 because error because the alternatives in np.where() are evaluated befor the selection is made.first before going into the function however, the denominator can be zero at that time. Closes #4701.
* TST: Make loadtxt able to load floats as hex strings.Charles Harris2015-02-131-0/+13
| | | | The strings must be produced by the python float.hex method.
* DOC: Updated docstring for histogram2d as suggested in issue #5538Åsmund Hjulstad2015-02-131-0/+31
| | | | Also, added unittest for [int, array] combination arguments
* Merge pull request #5495 from charris/cleanup-gh-4649Charles Harris2015-01-242-3/+31
|\ | | | | BUG: Fix genfromtext NameValidator arguments passed to easy_dtype.
| * MAINT: Make argument determination in NameValidator more precise.Charles Harris2015-01-231-1/+5
| | | | | | | | | | | | | | The function was useing `'u' in case_sensitive` to detect `upper`. Make that more precise with `case_sensitive.startswith('u'). Raise ValueError if case_sensitive has unrecognized value.
| * TST: Fix bug in test_dtype_with_converters_and_usecols.Charles Harris2015-01-231-2/+2
| | | | | | | | | | | | | | The case_sensitive argument to np.recfromcsv has a default value of 'lower'. That value was not previously correctly passed on, but is now, so the previous expected values in this test were incorrectly upper cased.
| * BUG: Fix genfromtext NameValidator arguments passed to easy_dtype.Alan Briolat2015-01-231-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | np.genfromtxt validates field names twice: once in genfromtxt and once in easy_dtype. Whilst the arguments to genfromtxt are used in the first validation, they aren't passed to easy_dtype (which is used only when dtype != None) and therefore in this case the default validation (strip non-alphanum, replace spaces) gets confusingly applied, ignoring genfromtxt's arguments. This patch adds fixes genfromtxt by passing the appropriate arguments onwards to easy_dtype. That is probably the least invasive way to fix the issue.
* | ENH: genfromtxt: Change 'nrows' to 'max_rows'.Warren Weckesser2015-01-231-12/+40
| |
* | ENH:Add keyword nrows to genfromtxt.styr2015-01-231-0/+26
|/ | | | | | | | | | This allows one to specify the maximum number of row processed in in a call. The new functionality allows for reading more complex data formats. For instance, multiple calls can be used to read in multiple arrays stored in a single file. Closes #5084. Closes #5093.
* TST: Add test for loadtxt with None as string type.Charles Harris2015-01-231-0/+8
|
* Merge pull request #5361 from JDWarner/arraypad_fixesCharles Harris2015-01-131-9/+496
|\ | | | | ENH: Improve arg handling & enhance test suite for `np.pad`
| * ENH: Improve arg handling & enhance test suite for np.padJosh Warner (Mac)2015-01-061-9/+496
| |
* | ENH: add np.nanprodStephan Hoyer2015-01-051-148/+81
|/ | | | | | | | | | | This PR adds an implementation of `nanprod`. The actual function is a two-liner adapted from `nansum`. Most of this PR consists of documentation and tests (for which I took the opportunity to do some consolidation). A method with the same functionality exists in pandas, and I was surprised to discover that it's not in numpy.
* BUG: digitize segfaults on TypeErrorjaimefrio2014-12-071-0/+7
| | | | | The new searchsorted-based digitize introduced in #5101 segfaults when it should raise a TypeError.
* Merge pull request #5319 from larsmans/c-fixesCharles Harris2014-12-021-0/+26
|\ | | | | MAINT: refactor packbits/unpackbits
| * ENH ensure np.packbits works on np.bool dtypeLars Buitinck2014-11-301-6/+10
| |
| * MAINT/TST: refactor and test packbits/unpackbitsLars Buitinck2014-11-301-0/+22
| | | | | | | | | | | | Pushes the GIL release one loop outward. First test for these functions (!). Incorporates suggestions by @jaimefrio and @charris.
* | BUG: Closes #2917: numpy.lib._iotools.StringConverter.upgrade returnGarrett-R2014-11-301-7/+11
|/ | | | numpy.lib._iotools.StringConverter.upgrade should have a return value
* TEST: added test of BagObjWendell Smith2014-11-181-0/+11
|
* Merge pull request #5214 from mkowoods/np.averageJulian Taylor2014-10-271-0/+5
|\ | | | | | | Update to average calculation
| * BUG: upcast weights to average result type to avoid inaccuraciesMalik Woods2014-10-271-0/+5
| | | | | | | | closes gh-5202
* | Merge pull request #5203 from njsmith/masterCharles Harris2014-10-211-2/+12
|\ \ | | | | | | BUG: copy inherited masks in MaskedArray.__array_finalize__
| * | BUG: copy inherited masks in MaskedArray.__array_finalize__Nathaniel J. Smith2014-10-211-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, operations which created a new masked array from an old masked array -- e.g., np.empty_like -- would tend to result in the new and old arrays sharing the same .mask attribute. This leads to horrible brokenness in which writes to one array affect the other. In particular this was responsible for part of the brokenness that @jenshnielsen reported in gh-5184 in which np.gradient on masked arrays would modify the original array's mask. This fixes the worst part of the issues addressed in gh-3404, though there's still an argument that we ought to deprecate the mask-copying behaviour entirely so that empty_like returns an array with an empty mask. That can wait until we find someone who cares though. I also applied a small speedup to np.gradient (avoiding one copy); previously this inefficiency was masking (heh) some of the problems with masked arrays, so removing it is both an optimization and makes it easier to test that things are working now.
* | | Merge branch 'master' of https://github.com/numpy/numpy into interp_with_periodsaullogiovani2014-10-176-5/+36
|\ \ \
| * \ \ Merge pull request #5182 from juliantaylor/nanmedian-infCharles Harris2014-10-161-0/+16
| |\ \ \ | | |/ / | | | | BUG: fix nanmedian on arrays containing inf
| | * | BUG: fix nanmedian on arrays containing infJulian Taylor2014-10-141-0/+16
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two issues: A masked divide of an infinite value is a masked value which means one can't use np.ma.mean to compute the median as infinity division is well defined. This behaviour seems wrong to me but it also looks intentional so changing it is not appropriate for a bugfix release. The second issue is that the ordering of the sorted masked array is undefined for equal values, the sorting considers infinity the largest floating point value which is not correct in respect to sorting where nan is considered larger. This is fixed by changing the minimum_fill_value to nan for float data in the masked sorts. Closes gh-5138
| * | BUG: Fixes #5184 gradient calculation behavior at boundariesDavid M Fobes2014-10-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Previous expected behavior was that the gradient is computed using central differences in the interior and first differences at the boundaries. * gradient was updated in v1.9.0 so that second-order accurate calculations are done at the boundaries, but this breaks expected behavior with old code, so `edge_order` keyword (Default: 1) is added to specify whether first or second order calculations at the boundaries should be used. * Since the second argument is *varargs, in order to maintain compatibility with old code and compatibility with python 2.6 & 2.7, **kwargs is used, and all kwargs that are not `edge_order` raise an error, listing the offending kwargs. * Tests and documentation updated to reflect this change. * Added `.. versionadded:: 1.9.1` to the new optional kwarg `edge_order` documentation, and specified supported `edge_order` kwarg values. * Clarified documentation for `varargs`. * Made indentation in docstring consistent with other docstring styles. * Examples corrected