From 3695763a5dd332cc7975a17828673fd730ffcab0 Mon Sep 17 00:00:00 2001 From: Martin Bubel Date: Sun, 8 Oct 2023 23:42:10 +0200 Subject: [PATCH] format on save --- GPy/testing/misc_tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GPy/testing/misc_tests.py b/GPy/testing/misc_tests.py index 8f418565..628b688d 100644 --- a/GPy/testing/misc_tests.py +++ b/GPy/testing/misc_tests.py @@ -4,24 +4,26 @@ import scipy as sp import GPy import warnings + class MiscTests(np.testing.TestCase): """ Testing some utilities of misc """ + def setUp(self): self._lim_val = np.finfo(np.float64).max self._lim_val_exp = np.log(self._lim_val) def test_safe_exp_upper(self): with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('always') # always print + warnings.simplefilter("always") # always print assert np.isfinite(np.exp(self._lim_val_exp)) assert np.isinf(np.exp(self._lim_val_exp + 1)) assert np.isfinite(GPy.util.misc.safe_exp(self._lim_val_exp + 1)) print(w) print(len(w)) - assert len(w)<=1 # should have one overflow warning + assert len(w) <= 1 # should have one overflow warning def test_safe_exp_lower(self): assert GPy.util.misc.safe_exp(1e-10) < np.inf