class TestMultiIndexingAutomated:
These tests use code to mimic the C-Code indexing for selection.
NOTE:
- This still lacks tests for complex item setting.
- If you change behavior of indexing, you might want to modify these tests to try more combinations.
- Behavior was written to match numpy version 1.8. (though a first version matched 1.7.)
- Only tuple indices are supported by the mimicking code. (and tested as of writing this)
- Error types should match most of the time as long as there is only one error. For multiple errors, what gets raised will usually not be the same one. They are not tested.
Update 2016-11-30: It is probably not worth maintaining this test indefinitely and it can be dropped if maintenance becomes a burden.
Method | _check_multi_index |
Check a multi index item getting and simple setting. |
Method | _check_single_index |
Check a single index item getting and simple setting. |
Method | _compare_index_result |
Compare mimicked result to indexing result. |
Method | _get_multi_index |
Mimic multi dimensional indexing. |
Method | setup |
Undocumented |
Method | test_1d |
Undocumented |
Method | test_boolean |
Undocumented |
Method | test_multidim |
Undocumented |
Instance Variable | a |
Undocumented |
Instance Variable | b |
Undocumented |
Instance Variable | complex_indices |
Undocumented |
Instance Variable | fill_indices |
Undocumented |
Instance Variable | simple_indices |
Undocumented |
Check a multi index item getting and simple setting.
Check a single index item getting and simple setting.
_check_multi_index
).Mimic multi dimensional indexing.
indices : tuple of index objects
arr[indices]
should be identical.True
,
np.may_share_memory(arr, arr[indices])
should be True
(with
some exceptions for scalars and possibly 0-d arrays).While the function may mostly match the errors of normal indexing this is generally not the case.