From 415d99d62d820211bc0afdcfe969f912f8fbcc91 Mon Sep 17 00:00:00 2001 From: Mike Croucher Date: Mon, 7 Sep 2015 16:41:14 +0100 Subject: [PATCH] Used scipy.log1p since it gives more consistent results cross-platform --- GPy/testing/link_function_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPy/testing/link_function_tests.py b/GPy/testing/link_function_tests.py index 2f8fc5a8..9f41f736 100644 --- a/GPy/testing/link_function_tests.py +++ b/GPy/testing/link_function_tests.py @@ -97,13 +97,13 @@ class LinkFunctionTests(np.testing.TestCase): #Check the clipping works np.testing.assert_almost_equal(link.transf(self.f_lower_lim), 0, decimal=5) #Need to look at most significant figures here rather than the decimals - np.testing.assert_approx_equal(link.transf(self.f_upper_lim), np.log1p(_lim_val), significant=5) + np.testing.assert_approx_equal(link.transf(self.f_upper_lim), scipy.special.log1p(_lim_val), significant=5) self.check_overflow(link, lim_of_inf) #Check that it would otherwise fail beyond_lim_of_inf = lim_of_inf + 10.0 old_err_state = np.seterr(over='ignore') - self.assertTrue(np.isinf(np.log1p(np.exp(beyond_lim_of_inf)))) + self.assertTrue(np.isinf(scipy.special.log1p(np.exp(beyond_lim_of_inf)))) np.seterr(**old_err_state)