summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | BUG: io: genfromtxt did not handle filling_values=0 correctly. Closes gh-2317.Warren Weckesser2014-08-151-0/+10
| | |
* | | Merge pull request #4929 from juliantaylor/charris-pep8-numpy-libCharles Harris2014-07-3117-619/+667
|\ \ \ | |/ / | | | Charris pep8 numpy lib
| * | STY: PEP8 compliance for numpy/lib/tests.Charles Harris2014-07-319-243/+243
| | | | | | | | | | | | | | | | | | | | | The possibly controversial part of this is making the nested array value lists PEP8 compliant, as there is something to be said aligning the values for clarity. In the end, it seemed like the easiest thing to do was to make them PEP8 compliant. The eye can get used to that.
| * | MAINT: Fix problems noted by pyflakes in numpy/lib/tests.Charles Harris2014-07-3115-378/+426
| |/
* | BUG: Avoid type promotion in tril and triu.Yotam Doron2014-07-291-0/+22
| |
* | BUG: Use `np.where` in np.triu/np.tril, fixes #4859jaimefrio2014-07-101-0/+12
| | | | | | | | | | Replaces the current method to zero items, from multiplication to using `np.where`.
* | Merge pull request #4828 from ogrisel/fix-isfileobj-py3Julian Taylor2014-06-301-12/+4
|\ \ | | | | | | FIX isfileobj accepts write-mode files under PY3
| * | Move tempdir context manager to numpy.testing.utilsOlivier Grisel2014-06-301-12/+4
| |/
* | BUG: handle rounding issue with histogram edges on float32 dataJulian Taylor2014-06-231-0/+7
|/ | | | | | | | | | | | Following inequality causes wrong counting at the edges and can be avoided by making the edge array of the same type as the input data. In [1]: np.around(np.float64(6010.36962890625), 5) Out[1]: 6010.3696300000001 In [2]: np.around(np.float32(6010.36962890625), 5) Out[2]: 6010.3701 Closes gh-4799
* BUG: Fixed piecewise function for 0d inputJuan Luis Cano Rodríguez2014-06-081-0/+10
| | | | | | | | | | When `x` has more than one element the condlist `[True, False]` is being made equivalent to `[[True, False]]`, which is correct. However, when `x` is zero dimensional the expected condlist is `[[True], [False]]`: this commit addresses the issue. Besides, the documentation stated that there could be undefined values but actually these are 0 by default: using `nan` would be desirable, but for the moment the docs were corrected. Closes #331.
* BUG: Correct behavior for lists of tuples in unique, closes #4785jaimefrio2014-06-061-0/+10
| | | | | | | | np.unique produces wrong results when passed a list of tuples and no keyword arguments, as it fails to recognize it as a multidim array, but handles it as a 1D array of objects. The only way around this seems to be to completely eliminate the fast path for non-array inputs using `set`.
* TST: add a format 2.0 roundtrip testJulian Taylor2014-06-031-0/+7
|
* BUG: fix test deleting temporary file before using it on windowsJulian Taylor2014-06-031-22/+28
| | | | | | | The version check was not valid for python3, though the whole logic can be removed with a finally clause. This requires that the savez tests need to cleanup the NpyzFile results which still hold an open file descriptor.
* Merge pull request #4760 from juliantaylor/masked-medianCharles Harris2014-06-021-1/+17
|\ | | | | ENH: rewrite ma.median to improve poor performance for multiple dimensions
| * ENH: use masked median for small multidimensional nanmediansJulian Taylor2014-06-021-1/+17
| |
* | ENH: add storage format 2.0 with 4 byte header length sizeJulian Taylor2014-06-021-2/+55
|/ | | | | | | | | | | | | The new format only increases the header length field to 4 bytes. allows storing structured arrays with a large number of named columns. The dtype serialization for these can exceed the 2 byte header length field required by the 1.0 format. The generic functions automatically use the 2.0 format if the to be stored data requires it. To avoid unintentional incompatibilies a UserWarning is emitted when this happens. If the format is not required the more compatible 1.0 format is used. Closes gh-4690
* TST: fix random failing histogram testJulian Taylor2014-05-301-1/+1
| | | | | histogramdd rounds by decimal=6 so the random numbers may not be outliers if they are below 1. + 1e6
* BUG: Don't let meshgrid ignore unknown kwargs. Fixes #4755.Michael McNeil Forbes2014-05-301-0/+7
|
* BUG: nanpercentile/nanmedian 0-d with output given.Sebastian Berg2014-05-281-40/+71
| | | | Also some PEP-8 fixes and test improvements
* ENH: added functionality nanpercentile to numpyDavid Freese2014-05-221-0/+90
| | | | | | Implemented a nanpercentile and associated tests as an extension of np.percentile to complement the other nanfunctions.
* ENH: Add the scipy NumpyVersion class.Charles Harris2014-05-151-0/+57
| | | | | The class is in numpy/lib/_version.py and can be used to compare numpy versions when the version goes to double digits.
* ENH: added functionality nanmedian to numpyDavid Freese2014-05-021-4/+94
| | | | | | | | | | Implemented a nanmedian and associated tests as an extension of np.median to complement the other nanfunctions Added negative values to the unit tests Cleaned up documentation of nanmedian
* Add tests using matricesMarten van Kerkwijk2014-04-221-0/+25
|
* ENH: add a 'return_counts=' keyword argument to `np.unique`jaimefrio2014-04-051-11/+39
| | | | | | | | | | | | | | | | This PR adds a new keyword argument to `np.unique` that returns the number of times each unique item comes up in the array. This allows replacing a typical numpy construct: unq, _ = np.unique(a, return_inverse=True) unq_counts = np.bincount(_) with a single line of code: unq, unq_counts = np.unique(a, return_counts=True) As a plus, it runs faster, because it does not need the extra operations required to produce `unique_inverse`.
* ENH: Better error w/ line num for bad column count in np.loadtxt()Daniel da Silva2014-04-051-2/+13
| | | | Resolves #2591. Adds more explicit error handling in line parsing loop.
* Merge pull request #3830 from jarondl/recfromcsvCharles Harris2014-03-281-0/+8
|\ | | | | MAINT (API?): organize npyio.recfromcsv defaults
| * TST: Added regression test for recfromcsv dtype error, as suggested by @hpauljYaron de Leeuw2014-02-281-0/+8
| |
* | Merge pull request #4542 from immerrr/fix-bincount-systemerrorCharles Harris2014-03-261-1/+18
|\ \ | | | | | | BUG: fix some errors raised when minlength is incorrect in np.bincount
| * | BUG: fix incorrect minlength handling in np.bincountimmerrr2014-03-261-1/+18
| | |
* | | Merge pull request #4509 from jaimefrio/twodim-speedupJulian Taylor2014-03-261-5/+39
|\ \ \ | |/ / |/| | ENH: speed-up of triangular matrix functions
| * | ENH: speed-up of triangular matrix functionsjaimefrio2014-03-251-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * `np.tri` now produces less intermediate arrays. Runs about 40% faster for general dtypes, up to 3x faster for boolean arrays. * `np.tril` now does smarter type conversions (thanks Julian!), and together with the improvements in `np.tri` now runs about 30% faster. `np.triu` runs almost 2x faster than before, but still runs 20% slower than `np.tril`, which is an improvement over the 50% difference before. * `np.triu_indices` and `np.tril_indices` do not call `np.mask_indices`, instead they call `np.where` directly on a boolean array created with `np.tri`. They now run roughly 2x faster. * Removed the constraint for the array to be square in calls to `np.triu_indices`, `np.tril_indices`, `np.triu_indices_from` and `np.tril_indices_from`.
* | | Merge pull request #4358 from seberg/fast-selectCharles Harris2014-03-241-6/+57
|\ \ \ | | | | | | | | ENH: Speed improvements and deprecations for np.select
| * | | ENH: Speed improvements and deprecations for np.selectSebastian Berg2014-03-231-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea for this (and some of the code) originally comes from Graeme B Bell (gh-3537). Choose is not as fast and pretty limited, so an iterative copyto is used instead. Closes gh-3259, gh-3537, gh-3551, and gh-3254
* | | | TST: add unittest for byte_boundsOlivier Grisel2014-03-191-0/+9
| | | |
* | | | TST: add some more testsJulian Taylor2014-03-171-0/+10
| |/ / |/| | | | | | | | | | | test for gh-4494 test median returns array scalars and works with object arrays
* | | MAINT: revert back to separate median implementationJulian Taylor2014-03-131-0/+14
| | | | | | | | | | | | | | | | | | Merging median and percentile make would break astropy and quantities as we don't call mean anymore. These packages rely on overriding mean to add their own median behavior.
* | | ENH: add extended axis and keepdims support to median and percentileJulian Taylor2014-03-131-17/+118
| | |
* | | remove assert in _get_ufunc_and_otypes, add a test in test_function_base.pyLeoMao2014-03-121-0/+6
|/ /
* | Merge pull request #4377 from ContinuumIO/as_strided_fixCharles Harris2014-03-011-0/+17
|\ \ | | | | | | Fix stride_stricks.as_strided function for object arrays
| * | Fix stride_stricks.as_strided function for object arraysJay Bourque2014-02-261-0/+17
| |/ | | | | | | Currently, calling as_strided for object array results in 'TypeError: Cannot change data-type for object array.'. Fix so that dtype of new array is only set for void dtype, as originally intended.
* | Merge pull request #4284 from robquant/histogramdd_rightmost_binedgeJulian Taylor2014-03-011-0/+24
|\ \ | | | | | | Closes issue #4266, fixes histogramdd treatment of events at rightmost binedge
| * | Fix histogramdd treatment of events at rightmost binedgeRobert Franke2014-02-121-0/+24
| | | | | | | | | | | | Fixes Github issue #4266
* | | BUG: accept non arrays in cor and corrcoeffJulian Taylor2014-02-271-0/+4
| |/ |/| | | | | closes gh-4295
* | Merge pull request #4302 from charris/fix-gh-605seberg2014-02-261-0/+2
|\ \ | | | | | | BUG: Make interp return NaN at NaN interpolation points.
| * | BUG: Make interp return NaN at NaN interpolation points.Charles Harris2014-02-161-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | A NaN interpolation point was interpreted as out of bounds on the left side, hence the value of the left parameter in the function call was returned. >>> np.interp(np.nan, [-10, 10], [-2, 2]) -2.0 NaN is a better choice. Closes #605.
* | ENH: tril and triu broadcastingalex2014-02-241-5/+29
| |
* | BUG: Fixes #2799jaimefrio2014-02-211-0/+4
| | | | | | | | | | Use `np.sort` instead of `sorted` when the input is a list and no indices are requested. Fixes #2799.
* | TST: do not use "ignore" to filter warningsSebastian Berg2014-02-212-10/+10
|/ | | | | | | | | | | | | | | | | When a warning is ignored (or raised once) in python, the warnings module will tag on a `__warningregistry__` dictionary to be able to filter these warnings in the future. This is tagged on to the current context, causing leakage to later calls (this is a bit more complex, since where the registry ends up depends on the layers between the original caller and warner). In short, tests should typically not use ignore but catch the warnings to avoid changing the user experience (or errors on duplicate test runs). Fixes an error on duplicate test runs (does not remove all "ignores" which may change behaviour outside tests). Closes gh-4340
* Merge pull request #4247 from jaimefrio/digitize-monotonicCharles Harris2014-02-111-0/+16
|\ | | | | BUG: check for monotonic bin arrays in digitize
| * STY: adapted code to `C_STYLE_GUIDE.rst.txt`.jaimefrio2014-02-091-5/+8
| | | | | | | | | | | | MAINT: rewrote `check_array_monotonic` to use array indices, not pointers. TST: tests for proper handling of bins with all items almost equal now check the return value for correctness, not just that an error is not raised.