diff options
Diffstat (limited to 'dev-python/lmfit/files/lmfit-1.3.1-np2.patch')
-rw-r--r-- | dev-python/lmfit/files/lmfit-1.3.1-np2.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/dev-python/lmfit/files/lmfit-1.3.1-np2.patch b/dev-python/lmfit/files/lmfit-1.3.1-np2.patch new file mode 100644 index 000000000000..6b6bbb2308cf --- /dev/null +++ b/dev-python/lmfit/files/lmfit-1.3.1-np2.patch @@ -0,0 +1,39 @@ +diff --git a/lmfit/parameter.py b/lmfit/parameter.py +index ca9ccc72..a7ec9a65 100644 +--- a/lmfit/parameter.py ++++ b/lmfit/parameter.py +@@ -181,9 +181,8 @@ def __reduce__(self): + params = [self[k] for k in self] + + # find the symbols from _asteval.symtable, that need to be remembered. +- sym_unique = self._asteval.user_defined_symbols() + unique_symbols = {key: deepcopy(self._asteval.symtable[key]) +- for key in sym_unique} ++ for key in self._asteval.user_defined_symbols()} + + return self.__class__, (), {'unique_symbols': unique_symbols, + 'params': params} +@@ -567,9 +566,8 @@ def dumps(self, **kws): + + """ + params = [p.__getstate__() for p in self.values()] +- sym_unique = self._asteval.user_defined_symbols() + unique_symbols = {key: encode4js(deepcopy(self._asteval.symtable[key])) +- for key in sym_unique} ++ for key in self._asteval.user_defined_symbols()} + return json.dumps({'unique_symbols': unique_symbols, + 'params': params}, **kws) + +diff --git a/tests/test_model.py b/tests/test_model.py +index 396ea0b1..24dfbfcd 100644 +--- a/tests/test_model.py ++++ b/tests/test_model.py +@@ -900,7 +900,7 @@ def test_independent_var_parsing(self): + yatan = stepmod2.eval(pars, x=x) + + assert (yatan-yline).std() > 0.1 +- assert (yatan-yline).ptp() > 1.0 ++ assert np.ptp(yatan-yline) > 1.0 + + voigtmod = Model(voigt) + assert 'x' in voigtmod.independent_vars |