From 7762758958b0209c85c32aebf15be0143b42efb9 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 4 Aug 2023 17:58:48 +0200 Subject: [PATCH] save original expression --- src/nmreval/fit/parameter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nmreval/fit/parameter.py b/src/nmreval/fit/parameter.py index 4090574..879b22e 100644 --- a/src/nmreval/fit/parameter.py +++ b/src/nmreval/fit/parameter.py @@ -116,8 +116,10 @@ class Parameter: self.namespace = None self.eval_allowed = True self._expr = None + self._expr_disp = None if isinstance(value, str): + self._expr_disp = value value = _prepare_namespace_string(value) self._expr = value self.var = False @@ -152,7 +154,7 @@ class Parameter: if self._expr is None: ret_string += ' (fixed)' else: - ret_string += f' (calc: {self._expr})' + ret_string += f' (calc: {self._expr_disp})' return ret_string @@ -213,7 +215,7 @@ class Parameter: def copy(self) -> Parameter: if self._expr: - val = self._expr + val = self._expr_disp else: val = self._value para_copy = Parameter(name=self.name, value=val, var=self.var, lb=self.lb, ub=self.ub)