Should pickle work for Function and Derivative? I found Sympy issue #4297
and the answer seems to be no.
Nevertheless, here is what I have:
I have a private dictionary containing expressions of symbols, and
everything works fine.
Then I created a new private dictionary that includes Function and
Derivative, and I can't pickle it. Here are some code snippets:
q1S, q2S = symbols('q1, q2')
q1F = Function('q1')
...
varX = globals()['CuspData']
fileName = os.path.join(config.pickle_dir, 'CuspData.pckl')
f = open(fileName, "wb")
varX = {'q1d0': q1F(tS), 'q1d1': Derivative(q1F(tS), tS)} # test
#with evaluate(False): pickle.dump(varX, f)
pickle.dump(varX, f)
f.close()
The error is "Can't pickle q1: attribute lookup q1 on __main__ failed"
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/6821930c-117b-4b15-abec-f003782dcf85n%40googlegroups.com.