@@ -4154,7 +4154,8 @@ def test_rank1(self, dt, xp):
41544154
41554155 # Test simple IIR
41564156 y_r = xp .asarray ([0 , 2 , 4 , 6 , 8 , 10. ], dtype = dt )
4157- sos = tf2sos (b , a )
4157+ bb , aa = map (np .asarray , (b , a ))
4158+ sos = tf2sos (bb , aa )
41584159 sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
41594160 assert_array_almost_equal (sosfilt (sos , x ), y_r )
41604161
@@ -4163,7 +4164,8 @@ def test_rank1(self, dt, xp):
41634164 # NOTE: This was changed (rel. to TestLinear...) to add a pole @zero:
41644165 a = xp .asarray ([1 , 0 ], dtype = dt )
41654166 y_r = xp .asarray ([0 , 1 , 3 , 5 , 7 , 9. ], dtype = dt )
4166- sos = tf2sos (b , a )
4167+ bb , aa = map (np .asarray , (b , a ))
4168+ sos = tf2sos (bb , aa )
41674169 sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
41684170 assert_array_almost_equal (sosfilt (sos , x ), y_r )
41694171
@@ -4193,12 +4195,13 @@ def test_rank2(self, dt, xp):
41934195 y_r2_a1 = xp .asarray ([[0 , 2 , 0 ], [6 , - 4 , 6 ], [12 , - 10 , 12 ],
41944196 [18 , - 16 , 18 ]], dtype = dt )
41954197
4196- sos = tf2sos (b , a )
4198+ bb , aa = map (np .asarray , (b , a ))
4199+ sos = tf2sos (bb , aa )
41974200 sos = xp .asarray (sos ) # XXX
41984201 y = sosfilt (sos , x , axis = 0 )
41994202 assert_array_almost_equal (y_r2_a0 , y )
42004203
4201- sos = tf2sos (b , a )
4204+ sos = tf2sos (bb , aa )
42024205 sos = xp .asarray (sos ) # XXX
42034206 y = sosfilt (sos , x , axis = 1 )
42044207 assert_array_almost_equal (y_r2_a1 , y )
@@ -4215,7 +4218,8 @@ def test_rank3(self, dt, xp):
42154218 a = xp .asarray ([0.5 , 0.5 ], dtype = dt )
42164219
42174220 # Test last axis
4218- sos = tf2sos (b , a )
4221+ bb , aa = map (np .asarray , (b , a )) # XXX until tf2sos is array api compatible
4222+ sos = tf2sos (bb , aa )
42194223 sos = xp .asarray (sos ) # XXX
42204224 y = sosfilt (sos , x )
42214225 for i in range (x .shape [0 ]):
0 commit comments