Closed Jhsmit closed 5 years ago
I can't reproduce the infinite recursion error. But I can make the last one. AFAICS the problem lies with Model, not Fit.
model = Model(...)
ode_model = ODEModel(...)
with open('/tmp/symfit.pickle', 'wb') as jar:
pickle.dump(model, jar)
with open('/tmp/symfit.pickle', 'rb') as jar:
pickle.load(jar)
with open('/tmp/symfit_ode.pickle', 'wb') as ode_jar:
pickle.dump(ode_model, ode_jar)
with open('/tmp/symfit_ode.pickle', 'rb') as ode_jar:
pickle.load(ode_jar)
With an ODEModel: Python 2.7: a class that defines slots without defining getstate cannot be pickled Python 3.5: No error.
With a normal Model: Python 2.7: a class that defines slots without defining getstate cannot be pickled Python 3.5: No errors.
However. It's a bit of a Heisenbug:
model = Model(...)
ode_model = ODEModel(...)
model(...)
ode_model(...)
with open('/tmp/symfit.pickle', 'wb') as jar:
pickle.dump(model, jar)
with open('/tmp/symfit.pickle', 'rb') as jar:
pickle.load(jar)
with open('/tmp/symfit_ode.pickle', 'wb') as ode_jar:
pickle.dump(ode_model, ode_jar)
with open('/tmp/symfit_ode.pickle', 'rb') as ode_jar:
pickle.load(ode_jar)
With an ODEModel:
Python 2.7:
a class that defines slots without defining getstate cannot be pickled
Python 3.5:
Can't pickle <function
With a normal Model: Python 2.7: a class that defines slots without defining getstate cannot be pickled Python 3.5: No errors.
Pcikle support has by now been added, closing.
symfit Fit objects can't be pickled (or loaded).
In Python 3.5.2 a RecursionError is raised when attempting to load a pickled object:
Same error when using
dill
in python 3.In Python 2. 7 a RecursionError is raised when attempting to dump an object: