summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* BUG: np.insert must copy index arraySebastian Berg2013-04-272-1/+6
| | | | Otherwise it would do in-place changes to it. Fixes gh-3279.
* Merge pull request #3225 from seberg/cleanup_subscript-mergenjsmith2013-04-126-320/+482
|\ | | | | Cleanup subscript rebased
| * TST: Clarify empty fancy index testSebastian Berg2013-04-121-4/+5
| |
| * MAINT: Error type fixup and clearer error messageSebastian Berg2013-04-122-7/+7
| | | | | | | | | | | | | | | | | | The first error types were changed to ValueError (or introduced) newly. Python seems to normally use IndexError or TypeError here, so changing back to IndexError. The second is just a clarification to say when the error actually occurs for the user.
| * STY: Use PyArray_BYTES to get char*Sebastian Berg2013-04-121-2/+2
| |
| * MAINT: Add lost code to array_subscript_fromobjectSebastian Berg2013-04-111-0/+8
| |
| * MAINT: Fixup merge mistakesSebastian Berg2013-04-111-2/+2
| |
| * ENH: Add exception to _nonzero_indices for zero-dim arraysHan Genuit2013-04-111-0/+9
| | | | | | | | | | | | This function causes a crash otherwise, because it loops over the number of dimensions to construct sub-iterators. If the number of dimensions is zero, the sub-iterators will not be initialized, causing problems later on.
| * BUG: Repair testsHan Genuit2013-04-111-1/+1
| | | | | | | | Oops..
| * BUG: Fix failing subscript test casesHan Genuit2013-04-112-30/+48
| | | | | | | | | | | | | | | | | | | | This fixes indexing with NumPy boolean scalar values, which caused crashes before. Both Python and NumPy boolean scalars now behave the same. This contains a few small changes to PyArrayMapIterNew, where the PyArrayMapIterObject is memset to zero and a fix for the crash, which was caused by _nonzero_indices, which did not initialize any iterators because ndim is zero for scalars. *IterNew will now check for scalars before running that part of the code.
| * DOC: Re-insert commentHan Genuit2013-04-111-1/+8
| |
| * BUG: Fix old case for boolean subscripts with non-matching shape.Han Genuit2013-04-111-1/+1
| | | | | | | | | | Conflicts: numpy/core/src/multiarray/mapping.c
| * STY: Text changes.Han Genuit2013-04-111-13/+6
| | | | | | | | | | Conflicts: numpy/core/src/multiarray/mapping.c
| * BUG: Multiple fixes from merging.Han Genuit2013-04-111-5/+5
| |
| * TST: Add more indexing tests.Han Genuit2013-04-111-8/+78
| |
| * ENH: Change IndexError to ValueError for integer conversion errors.Han Genuit2013-04-111-5/+10
| | | | | | | | | | Conflicts: numpy/core/src/multiarray/mapping.c
| * ENH: Optimize array_subscript by removing redundant error check.872013-04-111-5/+0
| |
| * BUG: Tuple conversion may not propagate errors from int conversion.872013-04-111-0/+1
| | | | | | | | | | Conflicts: numpy/core/src/multiarray/mapping.c
| * ENH: Small optimization for redundant PyArray_Check872013-04-111-2/+1
| | | | | | | | | | Conflicts: numpy/core/src/multiarray/mapping.c
| * BLD: Declare array_ass_item_object before use.872013-04-111-6/+6
| |
| * ENH: Cleanup subscript assignment code.Han2013-04-111-46/+66
| | | | | | | | | | Conflicts: numpy/core/src/multiarray/mapping.c
| * ENH: Rename array_ass_big_item to array_ass_item_objectHan2013-04-111-11/+10
| |
| * ENH: Optimization in subscript_simple for arrays with size > 1Han2013-04-111-22/+31
| |
| * ENH: Change silent integer conversion failure into index error.872013-04-111-4/+5
| |
| * ENH: Rename array_subscript to array_subscipt_fromobject and refactor ↵872013-04-112-197/+108
| | | | | | | | | | | | | | array_subscript_nice to array_subscript Conflicts: numpy/core/src/multiarray/mapping.c
| * ENH: Move Python related subscript code into array_subscript872013-04-111-6/+86
| |
| * ENH: Use array_subscript_asarray to ensure an array type return value872013-04-113-2/+12
| |
| * ENH: Move fancy indexing code and ellipse check code into own functions.872013-04-111-59/+71
| | | | | | | | | | Conflicts: numpy/core/src/multiarray/mapping.c
| * ENH: Cleanup and simplify array_item code.872013-04-114-32/+46
| | | | | | | | | | | | | | | | | | Rename array_big_item to array_item_asarray and move special case for array_item_nice into array_item_asscalar. Also remove redundant PyArray_Return and rename array_item_nice to array_item. Conflicts: numpy/core/src/multiarray/mapping.c
* | Merge pull request #3229 from jdkloe/masternjsmith2013-04-121-1/+1
|\ \ | | | | | | Fix for issue 3192
| * | replace exec by eval to ensure the c variable is defined for all relevant ↵Jos de Kloe2013-04-121-1/+1
|/ / | | | | | | python versions
* | Merge pull request #3227 from charris/2to3-apply-funcattrsCharles Harris2013-04-111-1/+1
|\ \ | | | | | | 2to3: Skip `funcattrs` fixer.
| * | 2to3: Skip `funcattrs` fixer.Charles Harris2013-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | In Python 3 the func.func_name attribute is replaced by the func.__name__ attribute. The only file affected by this is doc/sphinxext/numpydoc/phantom_import.py, and there its use is already version dependent. Closes #3054.
* | | Merge pull request #452 from seberg/enhdelnjsmith2013-04-113-63/+314
|\ \ \ | |/ / |/| | ENH: delete and insert generalization and speed improvements
| * | FIX: rename xrange to range in python 2Sebastian Berg2013-04-111-1/+4
| | | | | | | | | | | | | | | | | | np.delete abuses range to calculate start/stop/step and len. This would create potentially large intermediates if it was a list, so for numpy/lib/function_base.py and python < 3, use range = xrange.
| * | DOC: Fixup of delete/insert changes in release notesSebastian Berg2013-04-111-7/+13
| | |
| * | MAINT: np.delete keep old out of bound/negative index behaviorSebastian Berg2013-04-112-19/+36
| | |
| * | TST: New tests for insert/delete covering warnings and corner casesSebastian Berg2013-04-111-9/+65
| | |
| * | FIX: insert/delete fixes and warnings for non-integer indicesSebastian Berg2013-04-111-25/+43
| | |
| * | ENH: larger fixes for np.delete and np.insert functionsSebastian Berg2013-04-113-55/+206
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several smaller to larger problems for these two functions, that this addresses: * delete did not handle out of bound values graciously (ignoring negative ones) * both were unnecessarily slow due to use of sets * insert did not handle unsorted indices correctly Further changes: * Add FutureWarning for boolean obj, so it can be handled similar to a boolean mask with indexing. * Add FutureWarning to remove inconsistent special cases for 0-d arrays (neither insertion nor deletion along an axis make sense for a scalar) * Allow insertion of an array with more then one element along axis when obj is a sequence with a single item. (i.e. array([1])). * Reintroduce speed optimization for scalar in insert that existed in 1.6.
* | Merge pull request #3226 from charris/2to3-apply-buffer-fixerCharles Harris2013-04-111-1/+1
|\ \ | |/ |/| 2to3: Skip buffer fixer.
| * 2to3: Skip buffer fixer.Charles Harris2013-04-111-1/+1
|/ | | | | | | | | | The buffer object is replaced by memoryview in Python >= 3. The memory view object has also been backported to Python 2.7. However, the only use of `buffer1/1memoryview1 is in `numpy/core/tests/test_unicode.py` and there it is already version dependent: `memoryview` is used if the Python version is >= 3 and `buffer` is used otherwise. Closes #3043.
* Merge pull request #3223 from charris/2to3-skip-future-fixerCharles Harris2013-04-101-1/+1
|\ | | | | 2to3: Skip `future` fixer.
| * 2to3: Skip `future` fixer.Charles Harris2013-04-101-1/+1
|/ | | | | | The `future` fixer removes the `from __future__ import ...` statements. That is fine for Python 3, but we need to keep that statement if we are shooting for a common code base for both Python 2 and Python 3.
* Merge pull request #3216 from charris/2to3-apply-map-fixerCharles Harris2013-04-1024-127/+176
|\ | | | | 2to3: Apply `map` fixer.
| * 2to3: Apply `map` fixer.Charles Harris2013-04-1024-127/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python 3 `map` is an iterator while in Python 2 it returns a list. The simple fix applied by the fixer is to inclose all instances of map with `list(...)`. This is not needed in all cases, and even where appropriate list comprehensions may be preferred for their clarity. Consequently, this patch attempts to use list comprehensions where it makes sense. When the mapped function has two arguments there is another problem that can arise. In Python 3 map stops execution when the shortest argument list is exhausted, while in Python 2 it stops when the longest argument list is exhausted. Consequently the two argument case might need special care. However, we have been running Python3 converted versions of numpy since 1.5 without problems, so it is probably not something that affects us. Closes #3068
* | Merge pull request #3005 from jphalip/in1d-inverseCharles Harris2013-04-095-11/+59
|\ \ | | | | | | ENH: add `inverse` parameter to numpy.in1d().
| * | ENH: add `invert` parameter to numpy.in1d().Julien Phalip2013-04-085-11/+59
|/ /
* | Merge pull request #3210 from ivanov/github-issues-linkedCharles Harris2013-04-082-13/+11
|\ \ | |/ |/| DOC: point to the github issues page
| * DOC: incorporate @charris' suggestionsPaul Ivanov2013-04-082-2/+2
| | | | | | | | | | * Trac no longer used * Openining "new issue" on GitHub