Skip to content

Commit

Permalink
TST: Enable inteer array assignment test and add flat test
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed Jun 2, 2022
1 parent 68e7803 commit 63dd8c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions numpy/core/src/multiarray/nditer_constr.c
Expand Up @@ -715,6 +715,7 @@ NpyIter_Deallocate(NpyIter *iter)
*/
for (iop = 0; iop < nop; ++iop, ++dtype, ++object) {
if (op_itflags[iop] & NPY_OP_ITFLAG_HAS_WRITEBACK) {
printf("Writeback if copy!\n");
if (success && PyArray_ResolveWritebackIfCopy(*object) < 0) {
success = 0;
}
Expand Down
8 changes: 7 additions & 1 deletion numpy/core/tests/test_casting_floatingpoint_errors.py
Expand Up @@ -124,7 +124,7 @@ def integer_array_assignment():

arr[[0, 1]] = values

#yield integer_array_assignment
yield integer_array_assignment

def integer_array_assignment_with_subspace():
arr = np.empty((5, 3), dtype=dtype)
Expand All @@ -134,6 +134,12 @@ def integer_array_assignment_with_subspace():

yield integer_array_assignment_with_subspace

def flat_assignment():
arr = np.empty((3,), dtype=dtype)
values = np.array([value, value, value])
arr.flat[:] = values

yield flat_assignment

@pytest.mark.parametrize(["value", "dtype"], values_and_dtypes())
@pytest.mark.filterwarnings("ignore::numpy.ComplexWarning")
Expand Down

0 comments on commit 63dd8c5

Please sign in to comment.