summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add test for optional size argument for ndindexJay Bourque2013-01-091-0/+4
|/
* TST: Add test for in1d ravellingSebastian Berg2012-12-161-0/+13
| | | | | | The behavior of in1d is not really defined here, but it should be at least consistent over different execution branches. This is what it has been for most usages.
* BUG: Fix regression for in1d with non-array inputSebastian Berg2012-12-082-2/+7
| | | | | | | | | There was a regression introduced by the speed improvement in commit 6441c2a. This fixes it, and generally ravels the arrays for np.in1d. However it can be argued that at least the first array should not be ravelled in the future. Fixes "Issue gh-2755"
* DOC: Further tweaks to histogram2d docstring.Stefan van der Walt2012-11-261-9/+11
|
* [FIX] preserve memory order in np.copy()Nathaniel J. Smith2012-10-012-2/+30
| | | | | This switches us back to the behaviour seen in numpy 1.6 and earlier, which it turns out that scikit-learn (and probably others) relied on.
* Merge pull request #419 from stefanv/modinitnjsmith2012-09-171-1/+1
|\ | | | | Use PyMODINIT_FUNC and update docs accordingly.
| * Use PyMODINIT_FUNC and update docs accordingly.cgohlke2012-09-021-1/+1
| | | | | | | | See https://github.com/scipy/scipy/pull/279
* | MAINT: Use linspace instead of arange in some examples.endolith2012-09-171-3/+3
| | | | | | | | | | | | The original code used arange with offsets and scaling to generate sample points. Using linspace simplifies the code and clarifies the intent.
* | TST: Add test for boolean insertHan Genuit2012-09-071-0/+2
| |
* | TST: Add extra test for multidimensional inserts.Han Genuit2012-09-071-0/+7
| |
* | BUG: Fix for issues #378 and #392Han Genuit2012-09-071-6/+8
|/ | | | | | This should fix the problems with numpy.insert(), where the input values were not checked for all scalar types and where values did not get inserted properly, but got duplicated by default.
* Retain backward compatibility. Enforce C order.Stefan van der Walt2012-09-021-1/+9
|
* Improve ndindex execution speed.Stefan van der Walt2012-09-022-42/+15
|
* MAINT: silence DeprecationWarning in np.safe_eval().Ralf Gommers2012-08-221-4/+14
| | | | | It comes from the Python compiler package, which isn't available on Python 3.x. We already handle that issue by instead importing the ast module.
* BUG: Fix some tests in PR #192Travis E. Oliphant2012-07-171-8/+8
|
* Merge pull request #352 from HackerSchool12/bugfix808Travis E. Oliphant2012-07-172-14/+9
|\ | | | | BF bug #808
| * BUG: Ticket #808: Insert was not performing properly when an integer wasLoftie Ellis2012-07-152-14/+9
| | | | | | | | | | | | | | the argument passed to be used as the item to be insterted, and a list was passed as the positions. This was fixed by simply duplicating the item to be inserted so that it was a list of equal length and then control was passed to the already exsisting code to handel this case
* | Merge pull request #192 from rgommers/meshgrid3dTravis E. Oliphant2012-07-172-33/+134
|\ \ | | | | | | Meshgrid enhancements (>2-D, sparse grids, matrix indexing)
| * | STY: meshgrid: some minor changes to address review comments.Ralf Gommers2012-02-052-5/+2
| | |
| * | TST: meshgrid: test expected shapes for Cartesian and matrix indexing.Ralf Gommers2011-12-282-6/+23
| | |
| * | BUG: meshgrid: raise error on single input.Ralf Gommers2011-12-282-4/+9
| | |
| * | MAINT: clean up docstring and some minor items in meshgrid. Remove ndgrid.Ralf Gommers2011-12-132-44/+36
| | |
| * | ENH: enhance meshgrid to generate 3D grids, sparse grids, matrix indexing.Per A. Brodtkorb2011-12-132-34/+124
| | |
* | | Fix `WindowsError: [Error 32]` in test_not_closing_opened_fid ↵cgohlke2012-07-161-0/+1
| | | | | | | | | | | | (test_io.TestSavezLoad)
* | | STY: core: move non-Py3 specific stuff out from npy_3kcompat.h to private ↵Pauli Virtanen2012-07-131-0/+4
| |/ |/| | | | | | | | | npy_pycompat.h npy_3kcompat.h is semi-private, so this can be done.
* | Merge pull request #337 from rgommers/pull-335-genfromtxtRalf Gommers2012-07-113-7/+18
|\ \ | | | | | | BUG: make genfromtxt work with comments=None. Closes Github issue 329.
| * | BUG: genfromtxt: make comments=None work with spaces in strings.Ralf Gommers2012-07-112-3/+11
| | |
| * | BUG: make genfromtxt work with comments=None. Closes Github issue 329.martingoodson2012-07-102-4/+7
| | |
* | | BUG: test_unique needs to test bigger arrays.Charles Harris2012-07-111-37/+31
| | | | | | | | | | | | | | | | | | | | | | | | Small arrays are sorted with insertion sort, which is a stable sort. Consequently larger arrays are needed to check that the sort used is properly stable. The test was also refactored to make it more compact.
* | | TST: Improve type coverage in test_unique.Charles Harris2012-07-111-20/+57
| | |
* | | Merge pull request #309 from thouis/malloc_hooksnjsmith2012-07-111-2/+5
|\ \ \ | |/ / |/| | ENH: expose PyDataMem_NEW/FREE/RENEW as numpy API functions with an event hook.
| * | Merge remote-tracking branch 'upstream/master' into malloc_hooksThouis (Ray) Jones2012-07-064-16/+50
| |\ \
| * | | ENH: expose PyDataMem_NEW/FREE/RENEW as numpy API functions with an event hook.Thouis (Ray) Jones2012-06-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves PyDataMem_NEW/FREE/RENEW to the external API. Fixes PyDataMem_NEW/RENEW to return void* instead of char*. Replaces PyDataMem_NEW/FREE with NpySortArray_malloc/free in sort.c.src (should be reverted if npysort is moved to be part of multiarraymodule). Adds PyDataMem_SetEventHook which takes a (PyDataMem_EventHookFunc *) as an argument, with signature: void hook(void *old, void *new, size_t size). When not NULL, hook will be called at the end of each PyDataMem_NEW/FREE/RENEW: result = PyDataMem_NEW(size) -> (*hook(NULL, result, size) PyDataMem_FREE(ptr) -> (*hook(ptr, NULL, 0) result = PyDataMem_RENEW(ptr, size) -> (*hook)(ptr, result, size) Adds tests in multiarray_tests.c.src, driven by tests/test_multiarray.py.
* | | | DOC: merge doc wiki edits. A number of small edits in linalg and lib.Ralf Gommers2012-07-073-17/+22
| | | |
* | | | DOC: merge wiki edits. Add percentile to statistics routines (ML suggestion).Ralf Gommers2012-07-072-5/+5
| |/ / |/| |
* | | BF(PY3): open file handles in tests in binary modeYaroslav Halchenko2012-07-061-3/+3
| | | | | | | | | | | | | | | otherwise zipfile of python3 gets confused to receive bytes for the header whenever handle is opened for a text (unicode) file
* | | BF: removed too much -- own_fid should be False while working with .npzYaroslav Halchenko2012-07-051-0/+1
| | |
* | | ENH: added a rudimentary test for having #1517 (too many open files) fixedYaroslav Halchenko2012-07-051-0/+24
| | |
* | | ENH: Since file handle could not be reopened (during load()) -- no need for ↵Yaroslav Halchenko2012-07-051-17/+3
| | | | | | | | | | | | "isclosed" logic
* | | BF: PY3 and PY2 < 2.7 compatibility fixes for prev 2 commitsYaroslav Halchenko2012-07-021-6/+10
| | |
* | | ENH: unittest for preceeding commit fixing #2178Yaroslav Halchenko2012-07-021-0/+21
| | |
* | | BUG: do not "own" the FID for GzipFile and file if provided to load already ↵Yaroslav Halchenko2012-07-021-4/+12
| | | | | | | | | | | | | | | | | | opened (ticket #2178) Also made all assignments of own_file go in pair with assignments to fid to make things clearer
* | | Remove maskna API from ndarray, and all (and only) the code supporting itNathaniel J. Smith2012-06-162-14/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original masked-NA-NEP branch contained a large number of changes in addition to the core NA support. For example: - ufunc.__call__ support for where= argument - nditer support for arbitrary masks (in support of where=) - ufunc.reduce support for simultaneous reduction over multiple axes - a new "array assignment API" - ndarray.diagonal() returning a view in all cases - bug-fixes in __array_priority__ handling - datetime test changes etc. There's no consensus yet on what should be done with the maskna-related part of this branch, but the rest is generally useful and uncontroversial, so the goal of this branch is to identify exactly which code changes are involved in maskna support. The basic strategy used to create this patch was: - Remove the new masking-related fields from ndarray, so no arrays are masked - Go through and remove all the code that this makes dead/inaccessible/irrelevant, in a largely mechanical fashion. So for example, if I saw 'if (PyArray_HASMASK(a)) { ... }' then that whole block was obviously just dead code if no arrays have masks, and I removed it. Likewise for function arguments like skipna that are useless if there aren't any NAs to skip. This changed the signature of a number of functions that were newly exposed in the numpy public API. I've removed all such functions from the public API, since releasing them with the NA-less signature in 1.7 would create pointless compatibility hassles later if and when we add back the NA-related functionality. Most such functions are removed by this commit; the exception is PyArray_ReduceWrapper, which requires more extensive surgery, and will be handled in followup commits. I also removed the new ndarray.setasflat method. Reason: a comment noted that the only reason this was added was to allow easier testing of one branch of PyArray_CopyAsFlat. That branch is now the main branch, so that isn't an issue. Nonetheless this function is arguably useful, so perhaps it should have remained, but I judged that since numpy's API is already hairier than we would like, it's not a good idea to add extra hair "just in case". (Also AFAICT the test for this method in test_maskna was actually incorrect, as noted here: https://github.com/njsmith/numpyNEP/blob/master/numpyNEP.py so I'm not confident that it ever worked in master, though I haven't had a chance to follow-up on this.) I also removed numpy.count_reduce_items, since without skipna it became trivial. I believe that these are the only exceptions to the "remove dead code" strategy.
* | Merge pull request #290 from mforbes/new-vectorize-cleanTravis E. Oliphant2012-06-122-168/+307
|\ \ | | | | | | 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-312-168/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #306 from nouiz/fill_diagonalTravis E. Oliphant2012-06-122-4/+74
|\ \ \ | | | | | | | | fix the wrapping problem of fill_diagonal with tall matrix.
| * | | add the warp parameter to fill_diagonal for people that could want the old ↵Frederic2012-06-112-4/+49
| | | | | | | | | | | | | | | | behavior.
| * | | fix the wrapping problem of fill_diagonal with tall matrix.Frederic2012-06-112-1/+26
| | | |
* | | | remove unused variables from histogramddJake Vanderplas2012-06-111-2/+0
|/ / /
* | | Merge branch 'master' into clean-up-diagonalNathaniel J. Smith2012-06-063-24/+103
|\ \ \ | |/ /