diff options
author | Thouis (Ray) Jones <thouis@gmail.com> | 2012-06-06 10:32:35 +0200 |
---|---|---|
committer | Thouis (Ray) Jones <thouis@gmail.com> | 2012-06-06 11:22:45 +0200 |
commit | 56f865980447b2fc5475b1b71ef7347383660782 (patch) | |
tree | e3a41654332f891192d8c003026073616b247452 /numpy/core/arrayprint.py | |
parent | 4c68a33a5b75cbfed1aa0b3b23e947563b9a513a (diff) | |
download | numpy-56f865980447b2fc5475b1b71ef7347383660782.tar.gz |
Add check_and_adjust_index(), and replace most index checks with it.
This commit adds a check_and_adjust_index(npy_intp *index, npy_intp max, int axis) function
which checks index against max, setting an IndexError and returning -1 if it's not valid,
and otherwise adjusting index in-place to handle Python's negative indexing, and returning 0.
It also changes most places in the code where indexes were being checked and adjusted with a
call to this function.
Diffstat (limited to 'numpy/core/arrayprint.py')
0 files changed, 0 insertions, 0 deletions