summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
| * | Merge pull request #5178 from charris/fix-npz-header-incompatibilityJulian Taylor2014-10-133-0/+10
| |\ \ | | |/ | | | Fix npz header incompatibility
| | * TST: Add tests for Python2, Python3 *.npy compatibility.Charles Harris2014-10-123-0/+10
| | |
| * | Merge pull request #5149 from charris/fix-ma-docs-for-OO-optionJulian Taylor2014-10-042-2/+7
| |\ \ | | |/ | | | | | | BUG: Make numpy import when run with Python flag '-OO
| | * BUG: Make numpy import when run with Python flag '-OO'.Charles Harris2014-10-032-2/+7
| | | | | | | | | | | | | | | | | | | | | This consists of checking for a docstring equal to None and skipping two tests that require docstrings. Closes #5148.
* | | ENH: added parameter to use periodic x-coordinatessaullogiovani2014-10-021-0/+13
|/ /
* | Merge pull request #4622 from mhvk/lib/stride_tricks/subclassesseberg2014-09-261-1/+45
|\ \ | | | | | | ENH: add subok flag to stride_tricks (and thus broadcast_arrays)
| * | Convert as_strided input to array firstMarten van Kerkwijk2014-08-271-4/+17
| | |
| * | ENH: add subok flag to stride_tricks (and thus broadcast_arrays)Marten van Kerkwijk2014-08-251-1/+32
| | |
* | | ENH: Cast non-object arrays to float in np.polyjaimefrio2014-09-251-0/+11
| | | | | | | | | | | | | | | | | | Closes #5096. Casts integer arrays to np.double, to prevent integer overflow. Object arrays are left unchanged, to allow use of arbitrary precision objects.
* | | BUG: np.unique with chararray + inverse_indexCJ Carey2014-09-231-0/+6
| | | | | | | | | | | | | | | The call to `empty_like` was trying to use the `chararray` subclass, which doesn't support the `np.intp` dtype.
* | | Merge pull request #5022 from seberg/structured-insertCharles Harris2014-08-301-1/+11
|\ \ \ | | | | | | | | BUG: Fix np.insert for inserting a single item into a structured array
| * | | BUG: Fix np.insert for inserting a single item into a structured arraySebastian Berg2014-08-301-1/+11
| | | | | | | | | | | | | | | | | | | | Note that there are some object array special cases because of allowing multiple inserts. `np.array(..., dtype=object)` is not always clear.
* | | | Merge pull request #5006 from dhomeier/ioconv_usecolsJulian Taylor2014-08-271-0/+15
|\ \ \ \ | |/ / / | | | | | | | | BUG: fix genfromtxt check of converters when using usecols
| * | | BUG: fix genfromtxt check of converters when using usecolsDerek Homeier2014-08-271-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | fixes an issue reported by Adrian Altenhoff where user-supplied converters in genfromtxt were not tested with the right first_values when also specifying usecols.
* | | | Merge pull request #5005 from juliantaylor/use-tempdir-for-large-fileJulian Taylor2014-08-271-16/+16
|\ \ \ \ | |_|/ / |/| | | Use tempdir for large file
| * | | TST: skip large file test on windowsJulian Taylor2014-08-271-0/+2
| | | | | | | | | | | | | | | | nobody knows if it supports sparse filesystems, so just skip it.
| * | | BUG: avoid NamedTemporaryFile for large file testMatthew Brett2014-08-271-16/+14
| | | | | | | | | | | | | | | | NamedTemporaryFile files can't be reopened on Windows.
* | | | Merge pull request #4989 from juliantaylor/percentile-fixCharles Harris2014-08-241-0/+8
|\ \ \ \ | | |/ / | |/| | BUG: don't overwrite input percentile arrays
| * | | BUG: don't overwrite input percentile arraysJulian Taylor2014-08-241-0/+8
| | |/ | |/|
* | | 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
|