ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 30 Nov 2016 07:38:46 -0600How to save and load assumptions?http://ask.sagemath.org/question/35816/how-to-save-and-load-assumptions/ 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!
Wed, 30 Nov 2016 07:38:46 -0600http://ask.sagemath.org/question/35816/how-to-save-and-load-assumptions/