From 05d698ef2cf109845ea42310eb81b4c71b5f134e Mon Sep 17 00:00:00 2001 From: Martin Vonk <66305055+martinvonk@users.noreply.github.com> Date: Fri, 8 May 2026 21:18:31 +0200 Subject: [PATCH] Ensure covariance matrix is not None before processing Add check for non-null covariance matrix in fit result --- timflow/transient/fit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timflow/transient/fit.py b/timflow/transient/fit.py index c269eb5..24a229a 100755 --- a/timflow/transient/fit.py +++ b/timflow/transient/fit.py @@ -344,7 +344,7 @@ def fit_lmfit(self, report=False, printdot=True, **kwargs): self.parameters.loc[name, "optimal"] = self.fitresult.params.valuesdict()[ name ] - if hasattr(self.fitresult, "covar"): + if hasattr(self.fitresult, "covar") and self.fitresult.covar is not None: self.parameters["std"] = np.sqrt(np.diag(self.fitresult.covar)) self.parameters["perc_std"] = ( 100 * self.parameters["std"] / np.abs(self.parameters["optimal"])