@@ -4069,7 +4069,8 @@ def test_rank1(self, dt, xp):
40694069
40704070 # Test simple IIR
40714071 y_r = xp .asarray ([0 , 2 , 4 , 6 , 8 , 10. ], dtype = dt )
4072- sos = tf2sos (b , a )
4072+ bb , aa = map (np .asarray , (b , a ))
4073+ sos = tf2sos (bb , aa )
40734074 sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
40744075 assert_array_almost_equal (sosfilt (sos , x ), y_r )
40754076
@@ -4078,7 +4079,8 @@ def test_rank1(self, dt, xp):
40784079 # NOTE: This was changed (rel. to TestLinear...) to add a pole @zero:
40794080 a = xp .asarray ([1 , 0 ], dtype = dt )
40804081 y_r = xp .asarray ([0 , 1 , 3 , 5 , 7 , 9. ], dtype = dt )
4081- sos = tf2sos (b , a )
4082+ bb , aa = map (np .asarray , (b , a ))
4083+ sos = tf2sos (bb , aa )
40824084 sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
40834085 assert_array_almost_equal (sosfilt (sos , x ), y_r )
40844086
@@ -4108,12 +4110,13 @@ def test_rank2(self, dt, xp):
41084110 y_r2_a1 = xp .asarray ([[0 , 2 , 0 ], [6 , - 4 , 6 ], [12 , - 10 , 12 ],
41094111 [18 , - 16 , 18 ]], dtype = dt )
41104112
4111- sos = tf2sos (b , a )
4113+ bb , aa = map (np .asarray , (b , a ))
4114+ sos = tf2sos (bb , aa )
41124115 sos = xp .asarray (sos ) # XXX
41134116 y = sosfilt (sos , x , axis = 0 )
41144117 assert_array_almost_equal (y_r2_a0 , y )
41154118
4116- sos = tf2sos (b , a )
4119+ sos = tf2sos (bb , aa )
41174120 sos = xp .asarray (sos ) # XXX
41184121 y = sosfilt (sos , x , axis = 1 )
41194122 assert_array_almost_equal (y_r2_a1 , y )
@@ -4130,7 +4133,8 @@ def test_rank3(self, dt, xp):
41304133 a = xp .asarray ([0.5 , 0.5 ], dtype = dt )
41314134
41324135 # Test last axis
4133- sos = tf2sos (b , a )
4136+ bb , aa = map (np .asarray , (b , a )) # XXX until tf2sos is array api compatible
4137+ sos = tf2sos (bb , aa )
41344138 sos = xp .asarray (sos ) # XXX
41354139 y = sosfilt (sos , x )
41364140 for i in range (x .shape [0 ]):
0 commit comments