From 6149602aec7811c0654f76a2fef51aeab081d045 Mon Sep 17 00:00:00 2001 From: Alex Daniel Date: Wed, 27 Nov 2024 10:39:51 +0000 Subject: [PATCH] Seed the random numbers used for thickness error estimation Repeatable random results so the tests can pass --- qlayers/tests/test_thickness.py | 5 +++-- qlayers/thickness.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qlayers/tests/test_thickness.py b/qlayers/tests/test_thickness.py index 449c027..c1dfa45 100644 --- a/qlayers/tests/test_thickness.py +++ b/qlayers/tests/test_thickness.py @@ -159,5 +159,6 @@ def get_df(self, _): return df_wide thickness, thickness_err = cortical_thickness(MockQLayers(), est_error=True) - assert np.isclose(thickness, 8.98140) - assert np.isclose(thickness_err, 5.28871) + + assert np.isclose(thickness, 8.53326) + assert np.isclose(thickness_err, 4.72645) diff --git a/qlayers/thickness.py b/qlayers/thickness.py index e9c3b88..9f9ef38 100644 --- a/qlayers/thickness.py +++ b/qlayers/thickness.py @@ -3,6 +3,8 @@ from scipy import stats from scipy.optimize import curve_fit, fsolve +np.random.seed(0) + def logistic(x, L, x0, k): """