module documentation

Undocumented

Class TestIterNested Undocumented
Function iter_indices Undocumented
Function iter_iterindices Undocumented
Function iter_multi_index Undocumented
Function test_0d_iter Undocumented
Function test_all_allocated Undocumented
Function test_buffered_cast_error_paths Undocumented
Function test_buffered_cast_error_paths_unraisable Undocumented
Function test_close_equivalent using a context amanger and using nditer.close are equivalent
Function test_close_parameters Undocumented
Function test_close_raises Undocumented
Function test_debug_print Matches the expected output of a debug print with the actual output. Note that the iterator dump should not be considered stable API, this test is mainly to ensure the print does not crash.
Function test_iter_allocate_output_buffered_readwrite Undocumented
Function test_iter_allocate_output_errors Undocumented
Function test_iter_allocate_output_itorder Undocumented
Function test_iter_allocate_output_opaxes Undocumented
Function test_iter_allocate_output_simple Undocumented
Function test_iter_allocate_output_subtype Undocumented
Function test_iter_allocate_output_types_byte_order Undocumented
Function test_iter_allocate_output_types_promotion Undocumented
Function test_iter_allocate_output_types_scalar Undocumented
Function test_iter_allocated_array_dtypes Undocumented
Function test_iter_array_cast Undocumented
Function test_iter_array_cast_errors Undocumented
Function test_iter_assign_mapping Undocumented
Function test_iter_best_order Undocumented
Function test_iter_best_order_c_index_1d Undocumented
Function test_iter_best_order_c_index_2d Undocumented
Function test_iter_best_order_c_index_3d Undocumented
Function test_iter_best_order_f_index_1d Undocumented
Function test_iter_best_order_f_index_2d Undocumented
Function test_iter_best_order_f_index_3d Undocumented
Function test_iter_best_order_multi_index_1d Undocumented
Function test_iter_best_order_multi_index_2d Undocumented
Function test_iter_best_order_multi_index_3d Undocumented
Function test_iter_broadcasting Undocumented
Function test_iter_broadcasting_errors Undocumented
Function test_iter_buffered_cast_byteswapped Undocumented
Function test_iter_buffered_cast_byteswapped_complex Undocumented
Function test_iter_buffered_cast_simple Undocumented
Function test_iter_buffered_cast_structured_type Undocumented
Function test_iter_buffered_cast_structured_type_failure_with_cleanup Undocumented
Function test_iter_buffered_cast_subarray Undocumented
Function test_iter_buffered_reduce_reuse Undocumented
Function test_iter_buffering Undocumented
Function test_iter_buffering_badwriteback Undocumented
Function test_iter_buffering_delayed_alloc Undocumented
Function test_iter_buffering_growinner Undocumented
Function test_iter_buffering_reduction Undocumented
Function test_iter_buffering_reduction_reuse_reduce_loops Undocumented
Function test_iter_buffering_string Undocumented
Function test_iter_c_or_f_order Undocumented
Function test_iter_c_order Undocumented
Function test_iter_common_dtype Undocumented
Function test_iter_copy Undocumented
Function test_iter_copy_casts Undocumented
Function test_iter_copy_casts_structured Undocumented
Function test_iter_copy_if_overlap Undocumented
Function test_iter_dim_coalescing Undocumented
Function test_iter_element_deletion Undocumented
Function test_iter_f_order Undocumented
Function test_iter_flags_errors Undocumented
Function test_iter_iterindex Undocumented
Function test_iter_iterrange Undocumented
Function test_iter_itershape Undocumented
Function test_iter_nbo_align_contig Undocumented
Function test_iter_no_broadcast Undocumented
Function test_iter_no_inner_dim_coalescing Undocumented
Function test_iter_no_inner_full_coalesce Undocumented
Function test_iter_non_writable_attribute_deletion Undocumented
Function test_iter_object_arrays_basic Undocumented
Function test_iter_object_arrays_conversions Undocumented
Function test_iter_op_axes Undocumented
Function test_iter_op_axes_errors Undocumented
Function test_iter_reduction Undocumented
Function test_iter_reduction_error Undocumented
Function test_iter_refcount Undocumented
Function test_iter_remove_axis Undocumented
Function test_iter_remove_multi_index_inner_loop Undocumented
Function test_iter_scalar_cast Undocumented
Function test_iter_scalar_cast_errors Undocumented
Function test_iter_slice Undocumented
Function test_iter_too_large Undocumented
Function test_iter_too_large_with_multiindex Undocumented
Function test_iter_writable_attribute_deletion Undocumented
Function test_iter_write_buffering Undocumented
Function test_iter_writemasked Undocumented
Function test_iter_writemasked_badinput Undocumented
Function test_iter_writemasked_broadcast_error Undocumented
Function test_iter_writemasked_decref Undocumented
Function test_nditer_multi_index_set Undocumented
Function test_nditer_multi_index_set_refcount Undocumented
Function test_object_iter_cleanup Undocumented
Function test_object_iter_cleanup_large_reduce Undocumented
Function test_object_iter_cleanup_reduce Undocumented
Function test_partial_iteration_cleanup Checks for reference counting leaks during cleanup. Using explicit reference counts lead to occasional false positives (at least in parallel test setups). This test now should still test leaks correctly when run e...
Function test_partial_iteration_error Undocumented
Function test_warn_noclose Undocumented
Function test_writebacks Undocumented
Function _is_buffered Undocumented
def iter_indices(i): (source)

Undocumented

def iter_iterindices(i): (source)

Undocumented

def iter_multi_index(i): (source)

Undocumented

def test_0d_iter(): (source)

Undocumented

def test_all_allocated(): (source)

Undocumented

def test_buffered_cast_error_paths(): (source)

Undocumented

@pytest.mark.skipif(IS_WASM, reason='Cannot start subprocess')
@pytest.mark.skipif(not HAS_REFCOUNT, reason='PyPy seems to not hit this.')
def test_buffered_cast_error_paths_unraisable(): (source)

Undocumented

def test_close_equivalent(): (source)

using a context amanger and using nditer.close are equivalent

def test_close_parameters(): (source)

Undocumented

def test_close_raises(): (source)

Undocumented

def test_debug_print(capfd): (source)

Matches the expected output of a debug print with the actual output. Note that the iterator dump should not be considered stable API, this test is mainly to ensure the print does not crash.

Currently uses a subprocess to avoid dealing with the C level `printf`s.

def test_iter_allocate_output_buffered_readwrite(): (source)

Undocumented

def test_iter_allocate_output_errors(): (source)

Undocumented

def test_iter_allocate_output_itorder(): (source)

Undocumented

def test_iter_allocate_output_opaxes(): (source)

Undocumented

def test_iter_allocate_output_simple(): (source)

Undocumented

def test_iter_allocate_output_subtype(): (source)

Undocumented

def test_iter_allocate_output_types_byte_order(): (source)

Undocumented

def test_iter_allocate_output_types_promotion(): (source)

Undocumented

def test_iter_allocate_output_types_scalar(): (source)

Undocumented

def test_iter_allocated_array_dtypes(): (source)

Undocumented

def test_iter_array_cast(): (source)

Undocumented

def test_iter_array_cast_errors(): (source)

Undocumented

def test_iter_assign_mapping(): (source)

Undocumented

def test_iter_best_order(): (source)

Undocumented

def test_iter_best_order_c_index_1d(): (source)

Undocumented

def test_iter_best_order_c_index_2d(): (source)

Undocumented

def test_iter_best_order_c_index_3d(): (source)

Undocumented

def test_iter_best_order_f_index_1d(): (source)

Undocumented

def test_iter_best_order_f_index_2d(): (source)

Undocumented

def test_iter_best_order_f_index_3d(): (source)

Undocumented

def test_iter_best_order_multi_index_1d(): (source)

Undocumented

def test_iter_best_order_multi_index_2d(): (source)

Undocumented

def test_iter_best_order_multi_index_3d(): (source)

Undocumented

def test_iter_broadcasting(): (source)

Undocumented

def test_iter_broadcasting_errors(): (source)

Undocumented

def test_iter_buffered_cast_byteswapped(): (source)

Undocumented

def test_iter_buffered_cast_byteswapped_complex(): (source)

Undocumented

def test_iter_buffered_cast_simple(): (source)

Undocumented

def test_iter_buffered_cast_structured_type(): (source)

Undocumented

def test_iter_buffered_cast_structured_type_failure_with_cleanup(): (source)

Undocumented

def test_iter_buffered_cast_subarray(): (source)

Undocumented

@pytest.mark.slow
def test_iter_buffered_reduce_reuse(): (source)

Undocumented

def test_iter_buffering(): (source)

Undocumented

def test_iter_buffering_badwriteback(): (source)

Undocumented

def test_iter_buffering_delayed_alloc(): (source)

Undocumented

def test_iter_buffering_growinner(): (source)

Undocumented

def test_iter_buffering_reduction(): (source)

Undocumented

def test_iter_buffering_reduction_reuse_reduce_loops(): (source)

Undocumented

def test_iter_buffering_string(): (source)

Undocumented

def test_iter_c_or_f_order(): (source)

Undocumented

def test_iter_c_order(): (source)

Undocumented

def test_iter_common_dtype(): (source)

Undocumented

def test_iter_copy(): (source)

Undocumented

@pytest.mark.parametrize('dtype', np.typecodes['All'])
@pytest.mark.parametrize('loop_dtype', np.typecodes['All'])
@pytest.mark.filterwarnings('ignore::numpy.ComplexWarning')
def test_iter_copy_casts(dtype, loop_dtype): (source)

Undocumented

def test_iter_copy_casts_structured(): (source)

Undocumented

def test_iter_copy_if_overlap(): (source)

Undocumented

def test_iter_dim_coalescing(): (source)

Undocumented

def test_iter_element_deletion(): (source)

Undocumented

def test_iter_f_order(): (source)

Undocumented

def test_iter_flags_errors(): (source)

Undocumented

def test_iter_iterindex(): (source)

Undocumented

def test_iter_iterrange(): (source)

Undocumented

def test_iter_itershape(): (source)

Undocumented

def test_iter_nbo_align_contig(): (source)

Undocumented

def test_iter_no_broadcast(): (source)

Undocumented

def test_iter_no_inner_dim_coalescing(): (source)

Undocumented

def test_iter_no_inner_full_coalesce(): (source)

Undocumented

def test_iter_non_writable_attribute_deletion(): (source)

Undocumented

def test_iter_object_arrays_basic(): (source)

Undocumented

def test_iter_object_arrays_conversions(): (source)

Undocumented

def test_iter_op_axes(): (source)

Undocumented

def test_iter_op_axes_errors(): (source)

Undocumented

def test_iter_reduction(): (source)

Undocumented

def test_iter_reduction_error(): (source)

Undocumented

@pytest.mark.skipif(not HAS_REFCOUNT, reason='Python lacks refcounts')
def test_iter_refcount(): (source)

Undocumented

def test_iter_remove_axis(): (source)

Undocumented

def test_iter_remove_multi_index_inner_loop(): (source)

Undocumented

def test_iter_scalar_cast(): (source)

Undocumented

def test_iter_scalar_cast_errors(): (source)

Undocumented

def test_iter_slice(): (source)

Undocumented

def test_iter_too_large(): (source)

Undocumented

def test_iter_too_large_with_multiindex(): (source)

Undocumented

def test_iter_writable_attribute_deletion(): (source)

Undocumented

def test_iter_write_buffering(): (source)

Undocumented

@pytest.mark.parametrize('a', [np.zeros((3), dtype='f8'), np.zeros((9876, 3*5), dtype='f8')[::2, :], np.zeros((4, 312, 124, 3), dtype='f8')[::2, :, ::2, :], np.zeros((9), dtype='f8')[::3], np.zeros((9876, 3*10), dtype='f8')[::2, ::5], np.zeros((4, 312, 124, 3), dtype='f8')[::2, :, ::2, ::-1]])
def test_iter_writemasked(a): (source)

Undocumented

def test_iter_writemasked_badinput(): (source)

Undocumented

@pytest.mark.parametrize(['mask', 'mask_axes'], [(None, [-1, 0]), (np.zeros((1, 4), dtype='bool'), [0, 1]), (np.zeros((1, 4), dtype='bool'), None), (np.zeros(4, dtype='bool'), [-1, 0]), (np.zeros((), dtype='bool'), [-1, -1]), (np.zeros((), dtype='bool'), None)])
def test_iter_writemasked_broadcast_error(mask, mask_axes): (source)

Undocumented

def test_iter_writemasked_decref(): (source)

Undocumented

def test_nditer_multi_index_set(): (source)

Undocumented

@pytest.mark.skipif(not HAS_REFCOUNT, reason='Python lacks refcounts')
def test_nditer_multi_index_set_refcount(): (source)

Undocumented

def test_object_iter_cleanup(): (source)

Undocumented

@pytest.mark.parametrize('arr', [np.ones((8000, 4, 2), dtype=object)[:, ::2, :], np.ones((8000, 4, 2), dtype=object, order='F')[:, ::2, :], np.ones((8000, 4, 2), dtype=object)[:, ::2, :].copy('F')])
def test_object_iter_cleanup_large_reduce(arr): (source)

Undocumented

def test_object_iter_cleanup_reduce(): (source)

Undocumented

@pytest.mark.skipif((sys.version_info[:2] == (3, 9)) and (sys.platform == 'win32'), reason='Errors with Python 3.9 on Windows')
@pytest.mark.parametrize(['in_dtype', 'buf_dtype'], [('i', 'O'), ('O', 'i'), ('i,O', 'O,O'), ('O,i', 'i,O')])
@pytest.mark.parametrize('steps', [1, 2, 3])
def test_partial_iteration_cleanup(in_dtype, buf_dtype, steps): (source)

Checks for reference counting leaks during cleanup. Using explicit reference counts lead to occasional false positives (at least in parallel test setups). This test now should still test leaks correctly when run e.g. with pytest-valgrind or pytest-leaks

@pytest.mark.skipif(not HAS_REFCOUNT, reason='Python lacks refcounts')
@pytest.mark.parametrize(['in_dtype', 'buf_dtype'], [('O', 'i'), ('O,i', 'i,O')])
def test_partial_iteration_error(in_dtype, buf_dtype): (source)

Undocumented

@pytest.mark.skipif(not HAS_REFCOUNT, reason='Python lacks refcounts')
def test_warn_noclose(): (source)

Undocumented

def test_writebacks(): (source)

Undocumented

def _is_buffered(iterator): (source)

Undocumented