Hi all!
I had worked with a previous version of lmfit so far. However, I updated lmfit package to version 0.9.15 in Python 2.7
64b, and the following error is raising when adding initial parameters or creating a new Parameters
object (i.e. p = lmfit.Parameters()
):
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Python27_64b\lib\site-packages\lmfit\parameter.py", line 65, in __init__
super(Parameters, self).__init__(self)
File "C:\Python27_64b\lib\collections.py", line 48, in __init__
self.update(*args, **kwds)
File "C:\Python27_64b\lib\site-packages\lmfit\parameter.py", line 87, in update
for sym in other._asteval.user_defined_symbols():
AttributeError: 'Parameters' object has no attribute '_asteval'
I was just trying to do this simple example from https://lmfit.github.io/lmfit-py/examples/example_emcee_Model_interface.html:
import numpy as np
import lmfit
def double_exp(x, a1, t1, a2, t2):
return a1*np.exp(-x/t1) + a2*np.exp(-(x-0.1) / t2)
model = lmfit.Model(double_exp)
truths = (3.0, 2.0, -5.0, 10.0)
x = np.linspace(1, 10, 250)
np.random.seed(0)
y = double_exp(x, *truths)+0.1*np.random.randn(x.size)
p = model.make_params(a1=4, t1=3, a2=4, t2=3)
but it crashes with the error I showed above. The same error is raised when jus trying to create a new Parameters object:
import lmfit
p = lmfit.Parameters()
I am using the following versions:
I would appreciate if you could help me out.
Thank you!
Pablo.
Hi all!
I had worked with a previous version of lmfit so far. However, I updated lmfit package to version 0.9.15 in Python 2.7 64b, and the following error is raising when adding initial parameters or creating a new Parameters object (i.e.
p = lmfit.Parameters()
):
Traceback (most recent call last): File "<input>", line 1, in <module> File "C:\Python27_64b\lib\site-packages\lmfit\parameter.py", line 65, in __init__ super(Parameters, self).__init__(self) File "C:\Python27_64b\lib\collections.py", line 48, in __init__ self.update(*args, **kwds) File "C:\Python27_64b\lib\site-packages\lmfit\parameter.py", line 87, in update for sym in other._asteval.user_defined_symbols(): AttributeError: 'Parameters' object has no attribute '_asteval'
I was just trying to do this simple example from https://lmfit.github.io/lmfit-py/examples/example_emcee_Model_interface.html:
import numpy as np import lmfit
def double_exp(x, a1, t1, a2, t2): return a1*np.exp(-x/t1) + a2*np.exp(-(x-0.1) / t2) model = lmfit.Model(double_exp) truths = (3.0, 2.0, -5.0, 10.0) x = np.linspace(1, 10, 250) np.random.seed(0) y = double_exp(x, *truths)+0.1*np.random.randn(x.size) p = model.make_params(a1=4, t1=3, a2=4, t2=3)but it crashes with the error I showed above. The same error is raised when jus trying to create a new Parameters object: