How to save and load assumptions?

asked 2016-11-30 07:38:46 -0600

stan gravatar image

I use save_session() and load_session() to transfer data between worksheets, but I noticed that among other things, assumptions are not saved. So what I tried to do is save all assumptions in a separate list beforehand:

list_assumptions = assumptions()
save_session('temp/worksheet')

In the receiving worksheet, I tried:

load_session('temp/worksheet.sobj')
assumption1 = list_assumptions[1]
print assumption1
assumption1.assume()

but I get the following error:

a_s is real
TypeError: ECL says: Error executing code in Maxima: activate: no such context _SAGE_VAR_contextsage52

Interestingly, it works if I declare the assumption in the same way explicitly:

decl = sage.symbolic.assumptions.GenericDeclaration(a_s, 'real')
decl.assume()

And, by the way:

assumption1 == decl 
True

Is this a bug, or am I doing something wrong? Thanks for your help!

edit retag flag offensive close merge delete