Skip to content

Commit

Permalink
restore best-fit parameter values for high accuracy values of constra…
Browse files Browse the repository at this point in the history
…ined values
  • Loading branch information
newville committed Jul 27, 2023
1 parent 8b2038a commit 2a70f77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lmfit/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def create_uvars(self, covar=None):
uvars = {}
has_expr = False
vnames, vbest, vindex = [], [], -1
savevals = self.valuesdict()
for par in self.values():
has_expr = has_expr or par.expr is not None
if par.vary:
Expand Down Expand Up @@ -542,6 +543,9 @@ def create_uvars(self, covar=None):
uvars[par.name] = uval
except Exception:
par.stderr = 0
# restore all param values to saved best values
for parname, param in self.items():
param.value = savevals[parname]
return uvars

def dumps(self, **kws):
Expand Down

0 comments on commit 2a70f77

Please sign in to comment.