Skip to content

Commit

Permalink
Seed the random numbers used for thickness error estimation
Browse files Browse the repository at this point in the history
Repeatable random results so the tests can pass
  • Loading branch information
alexdaniel654 committed Nov 27, 2024
1 parent ec6139f commit 6149602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qlayers/tests/test_thickness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions qlayers/thickness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 6149602

Please sign in to comment.