From 8673e5acdb821ea152fefb5d8b520ef1110651dc Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 19 May 2023 16:00:04 +0200 Subject: [PATCH] catch error in f-test --- src/nmreval/fit/result.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nmreval/fit/result.py b/src/nmreval/fit/result.py index 95037f0..c888b32 100644 --- a/src/nmreval/fit/result.py +++ b/src/nmreval/fit/result.py @@ -320,7 +320,13 @@ class FitResult(Points): f_value = 1e318 else: f_value = (chi2-self.statistics['chi^2']) / (dof-self.dof) / self.statistics['red. chi^2'] - return f_value, 1-fdist.cdf(f_value, dof-self.dof, self.dof) + + try: + prob_f = 1-fdist.cdf(f_value, dof-self.dof, self.dof) + except: + prob_f = 0 + + return f_value, prob_f def get_state(self): state = super().get_state()