@@ -4069,7 +4069,8 @@ def test_rank1(self, dt, xp):
4069
4069
4070
4070
# Test simple IIR
4071
4071
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 )
4073
4074
sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
4074
4075
assert_array_almost_equal (sosfilt (sos , x ), y_r )
4075
4076
@@ -4078,7 +4079,8 @@ def test_rank1(self, dt, xp):
4078
4079
# NOTE: This was changed (rel. to TestLinear...) to add a pole @zero:
4079
4080
a = xp .asarray ([1 , 0 ], dtype = dt )
4080
4081
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 )
4082
4084
sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
4083
4085
assert_array_almost_equal (sosfilt (sos , x ), y_r )
4084
4086
@@ -4108,12 +4110,13 @@ def test_rank2(self, dt, xp):
4108
4110
y_r2_a1 = xp .asarray ([[0 , 2 , 0 ], [6 , - 4 , 6 ], [12 , - 10 , 12 ],
4109
4111
[18 , - 16 , 18 ]], dtype = dt )
4110
4112
4111
- sos = tf2sos (b , a )
4113
+ bb , aa = map (np .asarray , (b , a ))
4114
+ sos = tf2sos (bb , aa )
4112
4115
sos = xp .asarray (sos ) # XXX
4113
4116
y = sosfilt (sos , x , axis = 0 )
4114
4117
assert_array_almost_equal (y_r2_a0 , y )
4115
4118
4116
- sos = tf2sos (b , a )
4119
+ sos = tf2sos (bb , aa )
4117
4120
sos = xp .asarray (sos ) # XXX
4118
4121
y = sosfilt (sos , x , axis = 1 )
4119
4122
assert_array_almost_equal (y_r2_a1 , y )
@@ -4130,7 +4133,8 @@ def test_rank3(self, dt, xp):
4130
4133
a = xp .asarray ([0.5 , 0.5 ], dtype = dt )
4131
4134
4132
4135
# 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 )
4134
4138
sos = xp .asarray (sos ) # XXX
4135
4139
y = sosfilt (sos , x )
4136
4140
for i in range (x .shape [0 ]):
0 commit comments