From 5a153585ee45119f5118b079800aaa9511df20a9 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Tue, 29 Aug 2023 19:11:56 +0200 Subject: [PATCH] write error for global fits --- src/nmreval/fit/minimizer.py | 2 +- src/nmreval/fit/result.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nmreval/fit/minimizer.py b/src/nmreval/fit/minimizer.py index c4b8fae..9e43046 100644 --- a/src/nmreval/fit/minimizer.py +++ b/src/nmreval/fit/minimizer.py @@ -439,7 +439,7 @@ class FitRoutine(object): # update parameter values for keys, p_value, err_value in zip(var_pars, p, err): - if keys in data.parameter: + if keys in data.parameter.keys(): data.parameter[keys].scaled_value = p_value data.parameter[keys].scaled_error = err_value data.parameter[keys].namespace[keys] = data.parameter[keys].value diff --git a/src/nmreval/fit/result.py b/src/nmreval/fit/result.py index 09c550d..9cf6d5e 100644 --- a/src/nmreval/fit/result.py +++ b/src/nmreval/fit/result.py @@ -223,7 +223,6 @@ class FitResult(Points): return self.nobs-self.nvar def pprint(self, statistics=True, correlations=True): - sstream = StringIO() print('Fit result:') print(' model :', self.name) print(' #data :', self.nobs)