summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | ENH: added a rudimentary test for having #1517 (too many open files) fixedYaroslav Halchenko2012-07-051-0/+24
| |
* | ENH: unittest for preceeding commit fixing #2178Yaroslav Halchenko2012-07-021-0/+21
| |
* | Merge pull request #290 from mforbes/new-vectorize-cleanTravis E. Oliphant2012-06-121-27/+128
|\ \ | | | | | | ENH: Add kwarg support for vectorize (tickets #2100, #1156, and #1487) (clean)
| * | ENH: Add kwarg support for vectorize (tickets #2100, #1156, and #1487)Michael McNeil Forbes2012-05-311-27/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a substantial rewrite of vectorize to remove all introspection and caching behaviour. This greatly simplifies the logic of the code, and allows for much more generalized behaviour, simultaneously fixing tickets #1156, #1487, and #2100. There will probably be a performance hit because caching is no longer used (but should be able to be reinstated if needed). As vectorize is a convenience function with poor performance in general, perhaps this is okay. Rather than trying to inspect the function to determine the number of arguments, defaults, and argument names, we just use the arguments passed on the call to determine the behaviour on each call. All tests pass and code is fully covered Fixes: Ticket #2100: kwarg support for vectorize - API: Optional excluded argument to exclude some args from vectorization. - Added documentation, examples, and coverage tests - Added additional coverage test and base case for functions with no args - Factored original behaviour into _vectorize_call - Some minor documentation and error message corrections Ticket #1156: Support vectorizing over instance methods - No longer an issue since everything is determined by the call. Ticket: #1487: result depends on execution order - No longer caching, so the behaviour is as was expected. ENH: Simple cache for vectorize - Added simple cache to prevent vectorize from calling pyfunc twice on the first argument when determining the output types and added regression test. - Added documentation for excluded positional arguments. - Documentation cleanups. - Cleaned up variable names. ENH: Performance improvements for backward compatibility of vectorize. After some simple profiling, I found that the wrapping used to support the caching of the previous commit wasted more time than it saved, so I added a flag to allow the user to toggle. Moral: caching makes sense only if the function is expensive and is off by default. I also compared performance with the original vectorize and opted for keeping a cache of _ufunc if otypes is specified and there are no kwargs/excluded vars. This case is easy to implement, and allows users to reproduce (almost) the old performance characteristics if needed. (The new version is about 5% slower in this case). It would be much more complicated to add a similar cache in the case where kwargs are used, and since a wrapper is used here, the performance gain would be negligible (profiling showed that wrapping was a more significant slowdown than the extra call to frompyfunc). - API: Added cache kwarg which allows the user to toggle caching of the first result. - DOC: Added Notes section with a discussion of performance and a warning that vectorize should not be used for performance. - Added private _ufunc member to implement old-style of cache for special case with no kwargs, excluded, and with otypes specified. - Modified test case. Partially address ticket #1982 - I tried to use hasattr(outputs, '__len__') rather than isinstance(outputs, tuple) in order to allow for functions to return lists. This, however, means that strings will get vectorized over each character which breaks previous behaviour. Keeping old behaviour for now.
* | | add the warp parameter to fill_diagonal for people that could want the old ↵Frederic2012-06-111-0/+16
| | | | | | | | | | | | behavior.
* | | fix the wrapping problem of fill_diagonal with tall matrix.Frederic2012-06-111-0/+22
|/ /
* | BUG: Changed ipmt to accept array_like arguments.Tim Cera2012-05-201-0/+80
| | | | | | | | | | The ipmt function was also fixed to handle broadcasting. The tests were improved and extended to cover the broadcasting capability.
* | BUG: Fix some test bugs.Charles Harris2012-05-021-4/+4
| | | | | | | | | | Fix incorrect python version checks in test_print.py. Fix missing build_err_msg import and wrong variable in test_io.py.
* | BUG: Fix missing np prefix in test_function_base.py.Charles Harris2012-04-051-1/+1
| |
* | Merge pull request #245 from jseabold/digitize-open-rightTravis E. Oliphant2012-04-041-2/+25
|\ \ | | | | | | ENH: Give digitize left or right open interval option
| * | TST: Add namespaces to digitize tests + one more testSkipper Seabold2012-04-031-9/+17
| | |
| * | ENH: Give digitize left or right open interval optionSkipper Seabold2012-04-031-0/+15
| | |
* | | ENH: Add module containing functions for padding n-dimensional arrays.tim cera2012-04-041-0/+530
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The various padding functions are exposed as options to a public 'pad' function. Example: pad(a, 5, mode='mean') Current modes are 'constant', 'edge', 'linear_ramp', 'maximum', 'mean', 'median', 'minimum', 'reflect', 'symmetric', 'wrap', and <function> This commit includes unit tests and doctests and is based on feature request ticket #655.
* | STY: Style cleanups in numpy/lib/tests/test_function_base.Charles Harris2012-04-011-240/+245
| | | | | | | | | | Make imports from numpy.testing explicit. Use np namespace.
* | ENH: improve interp() speed in some cases.Timo Kluck2012-04-011-0/+5
| | | | | | | | | | | | The interp function was computing slopes for all intervals, even when there were only a few points to be interpolated. Now it only does so when the number of interpolation points exceeds the number of sample points.
* | TST: fix string comparison test failures on Windows for Python 2.5.Ralf Gommers2012-03-071-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | This is caused by the inconsistent floating point handling of Python itself. On Windows with 2.5: >>> "%s" % 1e-6 '1e-006' With 2.6: >>> "%s" % 1e-6 '1e-06' Reviewed as PR-225.
* | ENH: Allow bincount to accept empty arrays.Skipper Seabold2012-03-042-4/+11
| |
* | TST: filter one more printed warning.Ralf Gommers2012-03-021-3/+12
| | | | | | | | | | This one wasn't actually converted to a test error, because it's not a RuntimeWarning. Maybe need to add an option to raise on UserWarning too.
* | TST: filter RuntimeWarnings for invalids from some more test files.Ralf Gommers2012-03-021-8/+12
| | | | | | | | This should fix the test errors seen on both MinGW and MSVC9 related to this.
* | ENH: lib: break reference cycle in NpzFile (#2048)Pauli Virtanen2012-02-161-0/+15
| | | | | | | | | | This allows these objects to be freed by refcount, rather than requiring the gc, which can be useful in some situations.
* | Added ipmt (interest portion of payment) and ppmt (principal portion of ↵tim cera2012-02-121-9/+6
| | | | | | | | payment) functions. Added doctests and unit tests.
* | BUG: Fix improper usage of warning filters in the testsMark Wiebe2012-02-081-30/+46
| |
* | TST: Test gradient(...) of datetime64 and timedelta64 arrays.Ben Root2012-01-271-1/+19
| |
* | BUG: savetxt now handles complex arrays. Closes #1573.Paul Anton Letnes2011-12-281-0/+33
|/
* BUG: Fix polynomial tests.Stefan van der Walt2011-09-141-2/+2
|
* ENH: Add weights and covariance estimate to standard polyfit.Travis E. Oliphant2011-09-131-2/+25
|
* FIX: Make tril/triu return the same dtype as the original array.Fabian Pedregosa2011-08-311-0/+12
| | | | | | | This should fix: * http://projects.scipy.org/numpy/ticket/1848 * http://projects.scipy.org/scipy/ticket/1449
* ENH: Add function for adding docstrings to ufuncs.Chris Jordan-Squire2011-08-291-0/+12
|
* ENH: missingdata: Make numpy.all follow the NA && False == False ruleMark Wiebe2011-08-271-2/+2
|
* BUG: Some bugs in squeeze and concatenate found by testing SciPyMark Wiebe2011-08-272-0/+11
|
* ENH: umath: Make sum, prod, any, or functions use the .reduce method directlyMark Wiebe2011-08-271-1/+1
| | | | | | | | | | | This required some extensive changes, like: * Making logical_or, logical_and, and logical_not on object arrays behave like their Python equivalents instead of calling methods on the objects * Changing the units for a fair number of the binary operations to None, so they don't get initialized to their unit values at the start A consequence of this is that multi-dimensional reductions like sum, prod, any, or all no longer need to make copies, so are faster in some cases.
* BUG: loadtxt: There was some extra nesting for subarray dtypes (Ticket #1936)Mark Wiebe2011-08-201-0/+20
|
* ENH: Add provision for headers and footers to savetxt, fixes ticket 1236.Paul Anton Letnes2011-08-151-0/+35
| | | | | I suggest using a separate keyword argument for structured arrays. It might also be nice to be able to add a manual header.
* BUG: fix failing npyio test under py3k. Thanks to Derek Homeier. Closes #1793.Ralf Gommers2011-08-101-0/+1
|
* ENH: let genfromtxt return empty array for empty input file instead of an error.Paul Anton Letnes2011-07-311-5/+6
| | | | A warning for empty files is issued, including file name. Closes #1793.
* Merge branch 'deprecate_array_field_access'Mark Wiebe2011-07-263-18/+20
|\
| * STY: Remove trailing whitespaceMark Wiebe2011-07-261-1/+1
| |
| * TST: rec: DType in join_by test was inconsistentMark Wiebe2011-07-191-2/+3
| |
| * ENH: core: Some fixes, change some tests to not use yieldMark Wiebe2011-07-191-15/+16
| |
* | BUG: fixed histogramdd bug with empty inputs. Closes #1899.David Huard2011-07-242-2/+8
| |
* | BUG: datetime: Various fixes for datetime arrays.Ben Walsh2011-07-191-0/+9
|/
* Regression test for missing dtype and order args in asarray_chkfiniteLars Buitinck2011-07-191-0/+6
|
* Merge branch 'pull-105'Charles Harris2011-07-091-12/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pull-105: STY: Put spaces around the '&' and '|' operators. STY: Fix 'copy' 'copyto' typo and remove some trailing whitespace. ENH: Use np.copyto instead of np.fill in some places ENH: core: Add np.copyto, PyArray_MaskedMoveInto, PyArray_MaskedCopyInto ENH: core: Add support for masked strided transfer functions NEP: missingdata: Add a small note about single NA vs multi-NA NEP: missingdata: Describe a possible way multi-NA could be added in the future NEP: missingdata: Change the mask definition STY: Some small stylistic changes ENH: nditer: Add the basic checking and input of the MASK-related flags NEP: missingdata: Design the mask binary format so it's extensible with a payload DEP: core: Move 'fortran' macro into the deprecated header ENH: nditer: Add the per-operand masked iteration flags WRN: Get rid of some of the deprecation warnings about 'O4' DEP: core: Move NPY_AO into the deprecated API header
| * WRN: Get rid of some of the deprecation warnings about 'O4'Mark Wiebe2011-07-081-12/+12
| |
* | BUG: Fixed bugs in join_by and added testsSkipper Seabold2011-07-081-3/+64
|/
* Merge branch 'datetime-fixes'Mark Wiebe2011-06-071-8/+0
|\
| * ENH: Remove 'den' datetime metadata, move datetime_data to a C functionMark Wiebe2011-05-201-8/+0
| | | | | | | | | | | | | | | | | | The 'den' metadata was always 1, except during construction, so there is no reason for it to exist. The variable is kept in the struct for 1.6 ABI compatibility, however. The datetime_data function used ctypes. Moving the function to C is no more difficult, and a bit cleaner in my opinion.
* | ENH: speed up in1d() in the case of ar1 >> ar2. Closes #1603.rgommers2011-05-291-53/+49
|/ | | | | | A timing script justifying the switching criterion is attached to ticket 1603. Thanks to Neil Crighton.
* use np.atleast_Nd() to boost dimensions to ndminDerek Homeier2011-05-071-2/+16
|
* changed ndmin option in loadtxt to return shape (1, X.size) for single-row ↵Derek Homeier2011-05-071-2/+8
| | | | inputs