@@ -4154,7 +4154,8 @@ def test_rank1(self, dt, xp):
4154
4154
4155
4155
# Test simple IIR
4156
4156
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 )
4158
4159
sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
4159
4160
assert_array_almost_equal (sosfilt (sos , x ), y_r )
4160
4161
@@ -4163,7 +4164,8 @@ def test_rank1(self, dt, xp):
4163
4164
# NOTE: This was changed (rel. to TestLinear...) to add a pole @zero:
4164
4165
a = xp .asarray ([1 , 0 ], dtype = dt )
4165
4166
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 )
4167
4169
sos = xp .asarray (sos ) # XXX while tf2sos is numpy only
4168
4170
assert_array_almost_equal (sosfilt (sos , x ), y_r )
4169
4171
@@ -4193,12 +4195,13 @@ def test_rank2(self, dt, xp):
4193
4195
y_r2_a1 = xp .asarray ([[0 , 2 , 0 ], [6 , - 4 , 6 ], [12 , - 10 , 12 ],
4194
4196
[18 , - 16 , 18 ]], dtype = dt )
4195
4197
4196
- sos = tf2sos (b , a )
4198
+ bb , aa = map (np .asarray , (b , a ))
4199
+ sos = tf2sos (bb , aa )
4197
4200
sos = xp .asarray (sos ) # XXX
4198
4201
y = sosfilt (sos , x , axis = 0 )
4199
4202
assert_array_almost_equal (y_r2_a0 , y )
4200
4203
4201
- sos = tf2sos (b , a )
4204
+ sos = tf2sos (bb , aa )
4202
4205
sos = xp .asarray (sos ) # XXX
4203
4206
y = sosfilt (sos , x , axis = 1 )
4204
4207
assert_array_almost_equal (y_r2_a1 , y )
@@ -4215,7 +4218,8 @@ def test_rank3(self, dt, xp):
4215
4218
a = xp .asarray ([0.5 , 0.5 ], dtype = dt )
4216
4219
4217
4220
# 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 )
4219
4223
sos = xp .asarray (sos ) # XXX
4220
4224
y = sosfilt (sos , x )
4221
4225
for i in range (x .shape [0 ]):
0 commit comments