Skip to content

Commit 8cdc7de

Browse files
authored
Merge pull request #848 from bashtage/fix-invalid
MAINT: Avoid invalid division warning
2 parents 7f5f07f + 5de6730 commit 8cdc7de

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

arch/bootstrap/multiple_comparison.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ def _compute_max(self) -> None:
285285
RuntimeWarning,
286286
stacklevel=2,
287287
)
288+
std_devs[std_devs <= 0] = np.finfo(float).eps
288289
simulated_test_stat = incl_bs_avg_loss_err / std_devs
289290
simulated_test_stat = np.max(simulated_test_stat, 1)
290291
loss_diffs = incl_losses.mean(axis=0)

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ ignore = [
299299
"arch/unitroot/_phillips_ouliaris.py" = ["RUF002"]
300300
"arch/unitroot/_engle_granger.py" = ["RUF001"]
301301

302-
[tool.pytest.ini_options]
302+
[tool.pytest]
303303
strict_parametrization_ids = true
304304
minversion = "8.4.1"
305-
testpaths = "arch"
305+
testpaths = ["arch"]
306306
xfail_strict = true
307-
addopts = "--strict"
307+
addopts = ["--strict"]
308308
empty_parameter_set_mark = "xfail"
309309
filterwarnings = [
310310
"ignore:`formatargspec`:DeprecationWarning:statsmodels",
@@ -331,6 +331,7 @@ filterwarnings = [
331331
"error:seed is deprecated:FutureWarning",
332332
"error:get_state is deprecated:FutureWarning",
333333
"error:Conversion of an array with ndim:DeprecationWarning:arch",
334+
"error:invalid value encountered in divide:RuntimeWarning"
334335
]
335336
junit_family = "xunit2"
336337
markers = [

0 commit comments

Comments
 (0)