8000 Add changelog file · numpy/numpy@d5b5cda · GitHub
[go: up one dir, main page]

Skip to content

Commit d5b5cda

Browse files
committed
Add changelog file
1 parent 8e9af15 commit d5b5cda

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* 2-dimentional input arrays for ``np.cross`` have been deprecated.
2+
Use 3-dimentional arrays instead.

numpy/core/tests/test_numeric.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,12 +3570,9 @@ def test_array_likes(self):
35703570

35713571

35723572
class TestCross:
3573 10000 -
warning_filter_2_dim: str = (
3574-
"ignore:.*2-dimensional input arrays "
3575-
"are deprecated.*:DeprecationWarning"
3573+
@pytest.mark.filterwarnings(
3574+
"ignore:.*2-dimensional input arrays.*:DeprecationWarning"
35763575
)
3577-
3578-
@pytest.mark.filterwarnings(warning_filter_2_dim)
35793576
def test_2x2(self):
35803577
u = [1, 2]
35813578
v = [3, 4]
@@ -3585,7 +3582,9 @@ def test_2x2(self):
35853582
cp = np.cross(v, u)
35863583
assert_equal(cp, -z)
35873584

3588-
@pytest.mark.filterwarnings(warning_filter_2_dim)
3585+
@pytest.mark.filterwarnings(
3586+
"ignore:.*2-dimensional input arrays.*:DeprecationWarning"
3587+
)
35893588
def test_2x3(self):
35903589
u = [1, 2]
35913590
v = [3, 4, 5]
@@ -3604,7 +3603,9 @@ def test_3x3(self):
36043603
cp = np.cross(v, u)
36053604
assert_equal(cp, -z)
36063605

3607-
@pytest.mark.filterwarnings(warning_filter_2_dim)
3606+
@pytest.mark.filterwarnings(
3607+
"ignore:.*2-dimensional input arrays.*:DeprecationWarning"
3608+
)
36083609
def test_broadcasting(self):
36093610
# Ticket #2624 (Trac #2032)
36103611
u = np.tile([1, 2], (11, 1))
@@ -3635,7 +3636,9 @@ def test_broadcasting(self):
36353636
assert_equal(np.cross(v.T, u), -z)
36363637
assert_equal(np.cross(u, u), 0)
36373638

3638-
@pytest.mark.filterwarnings(warning_filter_2_dim)
3639+
@pytest.mark.filterwarnings(
3640+
"ignore:.*2-dimensional input arrays.*:DeprecationWarning"
3641+
)
36393642
def test_broadcasting_shapes(self):
36403643
u = np.ones((2, 1, 3))
36413644
v = np.ones((5, 3))

0 commit comments

Comments
 (0)
0