Skip to content

Commit 3a38bf5

Browse files
committed
fix test
1 parent bc539ac commit 3a38bf5

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tests/test_mglsadf.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@
2929
@pytest.mark.parametrize("mode", ["multi-stage", "single-stage", "freq-domain"])
3030
@pytest.mark.parametrize("c", [0, 10])
3131
def test_compatibility(
32-
device, ignore_gain, mode, c, alpha=0.42, M=24, P=80, L=400, fft_length=512
32+
device,
33+
ignore_gain,
34+
mode,
35+
c,
36+
alpha=0.42,
37+
M=24,
38+
P=80,
39+
L=400,
40+
fft_length=512,
41+
B=2,
3342
):
3443
if mode == "multi-stage":
3544
params = {"taylor_order": 7, "cep_order": 100}
@@ -71,12 +80,16 @@ def test_compatibility(
7180
eq=lambda a, b: np.corrcoef(a, b)[0, 1] > 0.98,
7281
)
7382

83+
S = T // 10
84+
U.check_differentiability(device, mglsadf, [(B, S), (B, S // P, M + 1)])
85+
7486

7587
@pytest.mark.parametrize("phase", ["zero", "maximum"])
7688
@pytest.mark.parametrize("ignore_gain", [False, True])
7789
def test_zero_and_maximum_phase(
7890
phase,
7991
ignore_gain,
92+
device="cpu",
8093
alpha=0.42,
8194
M=24,
8295
P=80,
@@ -116,7 +129,6 @@ def test_zero_and_maximum_phase(
116129
y3 = mglsadf3(x, mc).cpu().numpy()
117130
assert np.corrcoef(y1, y3)[0, 1] > 0.98
118131

119-
device = "cpu"
120132
S = T // 10
121133
U.check_differentiability(device, mglsadf1, [(B, S), (B, S // P, M + 1)])
122134
U.check_differentiability(device, mglsadf2, [(B, S), (B, S // P, M + 1)])
@@ -128,6 +140,7 @@ def test_zero_and_maximum_phase(
128140
def test_mixed_phase(
129141
phase,
130142
ignore_gain,
143+
device="cpu",
131144
alpha=0.42,
132145
M=24,
133146
P=80,
@@ -179,7 +192,6 @@ def test_mixed_phase(
179192
y3 = mglsadf3(x, mc_mix).cpu().numpy()
180193
assert np.corrcoef(y1, y3)[0, 1] > 0.98
181194

182-
device = "cpu"
183195
S = T // 10
184196
U.check_differentiability(device, mglsadf1, [(B, S), (B, S // P, 2 * M + 1)])
185197
U.check_differentiability(device, mglsadf2, [(B, S), (B, S // P, 2 * M + 1)])

0 commit comments

Comments
 (0)