Skip to content

Commit f342966

Browse files
committed
Reduce the size of the datasets to make the tests run faster
1 parent 6f2b0ea commit f342966

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pysteps/tests/test_timeseries_autoregression.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_estimate_ar_params_yw_localized():
5151

5252
for p in range(1, 4):
5353
gamma = correlation.temporal_autocorrelation(
54-
R[-(p + 1) :], window="gaussian", window_radius=50
54+
R[-(p + 1) :], window="gaussian", window_radius=25
5555
)
5656
phi = autoregression.estimate_ar_params_yw_localized(gamma)
5757
assert len(phi) == p + 1
@@ -63,20 +63,20 @@ def test_estimate_ar_params_ols_localized():
6363
R = _create_data_univariate()
6464

6565
for p in range(1, 4):
66-
phi = autoregression.estimate_ar_params_ols_localized(R[-(p + 1) :], p, 50)
66+
phi = autoregression.estimate_ar_params_ols_localized(R[-(p + 1) :], p, 25)
6767
assert len(phi) == p + 1
6868
for i in range(len(phi)):
6969
assert phi[i].shape == R.shape[1:]
7070

7171
phi = autoregression.estimate_ar_params_ols_localized(
72-
R[-(p + 1) :], p, 50, include_constant_term=True
72+
R[-(p + 1) :], p, 25, include_constant_term=True
7373
)
7474
assert len(phi) == p + 2
7575
for i in range(len(phi)):
7676
assert phi[i].shape == R.shape[1:]
7777

7878
phi = autoregression.estimate_ar_params_ols_localized(
79-
R[-(p + 2) :], p, 50, include_constant_term=True, d=1
79+
R[-(p + 2) :], p, 25, include_constant_term=True, d=1
8080
)
8181
assert len(phi) == p + 3
8282
for i in range(len(phi)):
@@ -115,21 +115,21 @@ def test_estimate_var_params_ols_localized():
115115
q = R.shape[1]
116116

117117
for p in range(1, 4):
118-
phi = autoregression.estimate_var_params_ols_localized(R[-(p + 1) :], p, 50)
118+
phi = autoregression.estimate_var_params_ols_localized(R[-(p + 1) :], p, 25)
119119
assert len(phi) == p + 1
120120
for i in range(len(phi)):
121121
assert phi[i].shape == (R.shape[2], R.shape[3], q, q)
122122

123123
phi = autoregression.estimate_var_params_ols_localized(
124-
R[-(p + 1) :], p, 50, include_constant_term=True
124+
R[-(p + 1) :], p, 25, include_constant_term=True
125125
)
126126
assert len(phi) == p + 2
127127
assert phi[0].shape == (R.shape[2], R.shape[3], q)
128128
for i in range(1, len(phi)):
129129
assert phi[i].shape == (R.shape[2], R.shape[3], q, q)
130130

131131
phi = autoregression.estimate_var_params_ols_localized(
132-
R[-(p + 2) :], p, 50, include_constant_term=True, d=1
132+
R[-(p + 2) :], p, 25, include_constant_term=True, d=1
133133
)
134134
assert len(phi) == p + 3
135135
assert phi[0].shape == (R.shape[2], R.shape[3], q)
@@ -154,7 +154,7 @@ def test_estimate_var_params_yw_localized():
154154

155155
for p in range(1, 4):
156156
gamma = correlation.temporal_autocorrelation_multivariate(
157-
R[-(p + 1) :], window="gaussian", window_radius=50
157+
R[-(p + 1) :], window="gaussian", window_radius=25
158158
)
159159
phi = autoregression.estimate_var_params_yw_localized(gamma)
160160
assert len(phi) == p + 1
@@ -174,7 +174,7 @@ def test_iterate_ar_localized():
174174
R = _create_data_univariate()
175175
p = 2
176176

177-
phi = autoregression.estimate_ar_params_ols_localized(R[-(p + 1) :], p, 50)
177+
phi = autoregression.estimate_ar_params_ols_localized(R[-(p + 1) :], p, 25)
178178
R_ = autoregression.iterate_ar_model(R, phi)
179179
assert R_.shape == R.shape
180180

@@ -192,7 +192,7 @@ def test_iterate_var_localized():
192192
R = _create_data_multivariate()
193193
p = 2
194194

195-
phi = autoregression.estimate_var_params_ols_localized(R[-(p + 1) :], p, 50)
195+
phi = autoregression.estimate_var_params_ols_localized(R[-(p + 1) :], p, 25)
196196
R_ = autoregression.iterate_var_model(R, phi)
197197
assert R_.shape == R.shape
198198

@@ -216,7 +216,7 @@ def _create_data_multivariate():
216216
R.append(np.stack([R_, np.roll(R_, 5, axis=0)]))
217217

218218
R = np.stack(R)
219-
R = R[:, :, -400:, 200:-200]
219+
R = R[:, :, 575:800, 255:480]
220220

221221
return R
222222

@@ -240,6 +240,6 @@ def _create_data_univariate():
240240
R.append(R_)
241241

242242
R = np.stack(R)
243-
R = R[:, -400:, 200:-200]
243+
R = R[:, 575:800, 255:480]
244244

245245
return R

0 commit comments

Comments
 (0)