File tree
17 files changed
+94
-64
lines changed- doc/release/upcoming_changes
- numpy
- _core
- src/multiarray
- tests
17 files changed
+94
-64
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + |
Lines changed: 2 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2888 | 2888 |
| |
2889 | 2889 |
| |
2890 | 2890 |
| |
2891 |
| - | |
| 2891 | + | |
| 2892 | + | |
2892 | 2893 |
| |
2893 | 2894 |
| |
2894 | 2895 |
| |
| |||
2901 | 2902 |
| |
2902 | 2903 |
| |
2903 | 2904 |
| |
2904 |
| - | |
2905 |
| - | |
2906 |
| - | |
2907 |
| - | |
2908 |
| - | |
2909 |
| - | |
2910 | 2905 |
| |
2911 | 2906 |
| |
2912 | 2907 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
848 | 848 |
| |
849 | 849 |
| |
850 | 850 |
| |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
851 | 860 |
| |
852 | 861 |
| |
853 | 862 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1910 | 1910 |
| |
1911 | 1911 |
| |
1912 | 1912 |
| |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
1913 | 1918 |
| |
1914 | 1919 |
| |
1915 | 1920 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
454 | 454 |
| |
455 | 455 |
| |
456 | 456 |
| |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + |
Lines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
435 | 435 |
| |
436 | 436 |
| |
437 | 437 |
| |
438 |
| - | |
| 438 | + | |
439 | 439 |
| |
440 |
| - | |
| 440 | + | |
441 | 441 |
| |
442 | 442 |
| |
443 | 443 |
| |
| |||
477 | 477 |
| |
478 | 478 |
| |
479 | 479 |
| |
480 |
| - | |
481 |
| - | |
482 |
| - | |
483 |
| - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
484 | 484 |
| |
485 | 485 |
| |
486 |
| - | |
| 486 | + | |
487 | 487 |
| |
488 | 488 |
| |
489 |
| - | |
| 489 | + | |
490 | 490 |
| |
491 | 491 |
| |
492 |
| - | |
| 492 | + | |
493 | 493 |
| |
494 | 494 |
| |
495 |
| - | |
| 495 | + | |
496 | 496 |
| |
497 | 497 |
| |
498 | 498 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
312 | 312 |
| |
313 | 313 |
| |
314 | 314 |
| |
315 |
| - | |
316 |
| - | |
| 315 | + | |
| 316 | + | |
317 | 317 |
| |
318 | 318 |
| |
319 | 319 |
| |
|
Lines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3218 | 3218 |
| |
3219 | 3219 |
| |
3220 | 3220 |
| |
3221 |
| - | |
| 3221 | + | |
3222 | 3222 |
| |
3223 | 3223 |
| |
3224 | 3224 |
| |
| |||
3323 | 3323 |
| |
3324 | 3324 |
| |
3325 | 3325 |
| |
3326 |
| - | |
3327 |
| - | |
| 3326 | + | |
| 3327 | + | |
3328 | 3328 |
| |
3329 | 3329 |
| |
3330 | 3330 |
| |
| |||
4626 | 4626 |
| |
4627 | 4627 |
| |
4628 | 4628 |
| |
4629 |
| - | |
| 4629 | + | |
4630 | 4630 |
| |
4631 | 4631 |
| |
4632 | 4632 |
| |
| |||
4637 | 4637 |
| |
4638 | 4638 |
| |
4639 | 4639 |
| |
4640 |
| - | |
| 4640 | + | |
4641 | 4641 |
| |
4642 |
| - | |
| 4642 | + | |
4643 | 4643 |
| |
4644 | 4644 |
| |
4645 | 4645 |
| |
4646 |
| - | |
4647 |
| - | |
| 4646 | + | |
| 4647 | + | |
4648 | 4648 |
| |
4649 | 4649 |
| |
4650 | 4650 |
| |
| |||
4664 | 4664 |
| |
4665 | 4665 |
| |
4666 | 4666 |
| |
4667 |
| - | |
| 4667 | + | |
4668 | 4668 |
| |
4669 | 4669 |
| |
4670 | 4670 |
| |
| |||
8296 | 8296 |
| |
8297 | 8297 |
| |
8298 | 8298 |
| |
8299 |
| - | |
| 8299 | + | |
8300 | 8300 |
| |
8301 | 8301 |
| |
8302 | 8302 |
| |
|
Lines changed: 22 additions & 21 deletions
<
10000
table aria-label="Diff for: numpy/_core/tests/test_nditer.py" class="tab-size width-full DiffLines-module__tableLayoutFixed--YZcIJ" data-diff-anchor="diff-152735d36b517d662c89133ff7c799da74875566c40a54b2b2c3ef306cb52b2e" data-tab-size="8" data-paste-markdown-skip="true" role="grid" style="--line-number-cell-width:52px;--line-number-cell-width-unified:104px">Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ def test_iter_best_order():
100
100
i = nditer(aview, [], [['readonly']])
101
101
assert_equal(list(i), a)
102
102
# Fortran-order
103
- i = nditer(aview.T, [], [['readonly']])
103
+ i = nditer(aview.transpose(), [], [['readonly']])
104
104
assert_equal(list(i), a)
105
105
# Other order
106
106
if len(shape) > 2:
@@ -126,8 +126,8 @@ def test_iter_c_order():
126
126
i = nditer(aview, order='C')
127
127
assert_equal(list(i), aview.ravel(order='C'))
128
128
# Fortran-order
129
- i = nditer(aview.T, order='C')
130
- assert_equal(list(i), aview.T.ravel(order='C'))
129
+ i = nditer(aview.transpose(), order='C')
130
+ assert_equal(list(i), aview.transpose().ravel(order='C'))
131
131
# Other order
132
132
if len(shape) > 2:
133
133
i = nditer(aview.swapaxes(0, 1), order='C')
@@ -153,8 +153,8 @@ def test_iter_f_order():
153
153
i = nditer(aview, order='F')
154
154
assert_equal(list(i), aview.ravel(order='F'))
155
155
# Fortran-order
156
- i = nditer(aview.T, order='F')
157
- assert_equal(list(i), aview.T.ravel(order='F'))
156
+ i = nditer(aview.transpose(), order='F')
157
+ assert_equal(list(i), aview.transpose().ravel(order='F'))
158
158
# Other order
159
159
if len(shape) > 2:
160
160
i = nditer(aview.swapaxes(0, 1), order='F')
@@ -180,8 +180,8 @@ def test_iter_c_or_f_order():
180
180
i = nditer(aview, order='A')
181
181
assert_equal(list(i), aview.ravel(order='A'))
182
182
# Fortran-order
183
- i = nditer(aview.T, order='A')
184
- assert_equal(list(i), aview.T.ravel(order='A'))
183
+ i = nditer(aview.transpose(), order='A')
184
+ assert_equal(list(i), aview.transpose().ravel(order='A'))
185
185
# Other order
186
186
if len(shape) > 2:
187
187
i = nditer(aview.swapaxes(0, 1), order='A')
@@ -467,7 +467,7 @@ def test_iter_no_inner_full_coalesce():
467
467
assert_equal(i.ndim, 1)
468
468
assert_equal(i[0].shape, (size,))
469
469
# Fortran-order
470
- i = nditer(aview.T, ['external_loop'], [['readonly']])
470
+ i = nditer(aview.transpose(), ['external_loop'], [['readonly']])
471
471
assert_equal(i.ndim, 1)
472
472
assert_equal(i[0].shape, (size,))
473
473
# Other order
@@ -515,26 +515,26 @@ def test_iter_dim_coalescing():
515
515
assert_equal(i.ndim, 1)
516
516
i = nditer(a3d.swapaxes(0, 1), ['c_index'], [['readonly']])
517
517
assert_equal(i.ndim, 3)
518
- i = nditer(a3d.T, ['c_index'], [['readonly']])
518
+ i = nditer(a3d.transpose(), ['c_index'], [['readonly']])
519
519
assert_equal(i.ndim, 3)
520
- i = nditer(a3d.T, ['f_index'], [['readonly']])
520
+ i = nditer(a3d.transpose(), ['f_index'], [['readonly']])
521
521
assert_equal(i.ndim, 1)
522
- i = nditer(a3d.T.swapaxes(0, 1), ['f_index'], [['readonly']])
522
+ i = nditer(a3d.transpose().swapaxes(0, 1), ['f_index'], [['readonly']])
523
523
assert_equal(i.ndim, 3)
524
524
525
525
# When C or F order is forced, coalescing may still occur
526
526
a3d = arange(24).reshape(2, 3, 4)
527
527
i = nditer(a3d, order='C')
528
528
assert_equal(i.ndim, 1)
529
- i = nditer(a3d.T, order='C')
529
+ i = nditer(a3d.transpose(), order='C')
530
530
assert_equal(i.ndim, 3)
531
531
i = nditer(a3d, order='F')
532
532
assert_equal(i.ndim, 3)
533
- i = nditer(a3d.T, order='F')
533
+ i = nditer(a3d.transpose(), order='F')
534
534
assert_equal(i.ndim, 1)
535
535
i = nditer(a3d, order='A')
536
536
assert_equal(i.ndim, 1)
537
- i = nditer(a3d.T, order='A')
537
+ i = nditer(a3d.transpose(), order='A')
538
538
assert_equal(i.ndim, 1)
539
539
540
540
def test_iter_broadcasting():
@@ -800,7 +800,7 @@ def test_iter_slice():
800
800
assert_equal(i[0:2], [3, 12])
801
801
802
802
def test_iter_assign_mapping():
803
- a = np.arange(24, dtype='f8').reshape(2, 3, 4).T
803
+ a = np.arange(24, dtype='f8').reshape(2, 3, 4).transpose()
804
804
it = np.nditer(a, [], [['readwrite', 'updateifcopy']],
805
805
casting='same_kind', op_dtypes=[np.dtype('f4')])
806
806
with it:
@@ -919,7 +919,7 @@ def test_iter_array_cast():
919
919
assert_equal(i.operands[0].strides, (96, 8, 32))
920
920
921
921
# Same-kind cast 'f8' -> 'f4' -> 'f8'
922
- a = np.arange(24, dtype='f8').reshape(2, 3, 4).T
922
+ a = np.arange(24, dtype='f8').reshape(2, 3, 4).transpose()
923
923
with nditer(a, [],
924
924
[['readwrite', 'updateifcopy']],
925
925
casting='same_kind',
@@ -1292,7 +1292,8 @@ def test_iter_op_axes():
1292
1292
i = nditer([a, a.T], [], [['readonly']] * 2, op_axes=[[0, 1], [1, 0]])
1293
1293
assert_(all([x == y for (x, y) in i]))
1294
1294
a = arange(24).reshape(2, 3, 4)
1295
- i = nditer([a.T, a], [], [['readonly']] * 2, op_axes=[[2, 1, 0], None])
1295
+ i = nditer([a.transpose(), a], [], [['readonly']] * 2,
1296
+ op_axes=[[2, 1, 0], None])
1296
1297
assert_(all([x == y for (x, y) in i]))
1297
1298
1298
1299
# Broadcast 1D to any dimension
@@ -1527,7 +1528,7 @@ def test_iter_allocate_output_itorder():
1527
1528
assert_equal(i.operands[1].strides, a.strides)
1528
1529
assert_equal(i.operands[1].dtype, np.dtype('f4'))
1529
1530
# F-order input, best iteration order
1530
- a = arange(24, dtype='i4').reshape(2, 3, 4).T
1531
+ a = arange(24, dtype='i4').reshape(2, 3, 4).transpose()
1531
1532
i = nditer([a, None], [], [['readonly'], ['writeonly', 'allocate']],
1532
1533
op_dtypes=[None, np.dtype('f4')])
1533
1534
assert_equal(i.operands[1].shape, a.shape)
@@ -1791,7 +1792,7 @@ def test_iter_buffering():
1791
1792
# Test buffering with several buffer sizes and types
1792
1793
arrays = []
1793
1794
# F-order swapped array
1794
- _tmp = np.arange(24, dtype='c16').reshape(2, 3, 4).T
1795
+ _tmp = np.arange(24, dtype='c16').reshape(2, 3, 4).transpose()
1795
1796
_tmp = _tmp.view(_tmp.dtype.newbyteorder()).byteswap()
1796
1797
arrays.append(_tmp)
1797
1798
# Contiguous 1-dimensional array
@@ -1802,7 +1803,7 @@ def test_iter_buffering():
1802
1803
a[:] = np.arange(16, dtype='i4')
1803
1804
arrays.append(a)
1804
1805
# 4-D F-order array
1805
- arrays.append(np.arange(120, dtype='i4').reshape(5, 3, 2, 4).T)
1806
+ arrays.append(np.arange(120, dtype='i4').reshape(5, 3, 2, 4).transpose())
1806
1807
for a in arrays:
1807
1808
for buffersize in (1, 2, 3, 5, 8, 11, 16, 1024):
1808
1809
vals = []
@@ -1821,7 +1822,7 @@ def test_iter_write_buffering():
1821
1822
# Test that buffering of writes is working
1822
1823
1823
1824
# F-order swapped array
1824
- a = np.arange(24).reshape(2, 3, 4).T
1825
+ a = np.arange(24).reshape(2, 3, 4).transpose()
1825
1826
a = a.view(a.dtype.newbyteorder()).byteswap()
1826
1827
i = nditer(a, ['buffered'],
1827
1828
[['readwrite', 'nbo', 'aligned']],
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
876 | 876 |
| |
877 | 877 |
| |
878 | 878 |
| |
879 |
| - | |
| 879 | + | |
880 | 880 |
| |
881 | 881 |
| |
882 | 882 |
| |
| |||
895 | 895 |
| |
896 | 896 |
| |
897 | 897 |
| |
898 |
| - | |
| 898 | + | |
899 | 899 |
| |
900 | 900 |
| |
901 | 901 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
344 |
| - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
345 | 348 |
| |
346 | 349 |
| |
347 | 350 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1033 | 1033 |
| |
1034 | 1034 |
| |
1035 | 1035 |
| |
1036 |
| - | |
1037 |
| - | |
| 1036 | + | |
| 1037 | + | |
1038 | 1038 |
| |
1039 | 1039 |
| |
1040 | 1040 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
413 | 413 |
| |
414 | 414 |
| |
415 | 415 |
| |
416 |
| - | |
| 416 | + | |
417 | 417 |
| |
418 | 418 |
| |
419 | 419 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2752 | 2752 |
| |
2753 | 2753 |
| |
2754 | 2754 |
| |
2755 |
| - | |
| 2755 | + | |
2756 | 2756 |
| |
2757 | 2757 |
| |
2758 | 2758 |
| |
|
0 commit comments