It appeared, that problem is with cache.
Clearing cache solves the problem.

Now, I want to ask, how cache is working in multithreaded environment?
Do all people share same cache?

On Wednesday, February 25, 2015 at 4:11:03 PM UTC+2, Paul Royik wrote:
>
> Hello.
>
> I recently needed to make all variables in expression positive.
>
> I do this like following:
>
> f = log(x)
> a=Wild('a')
> symbols = f.free_symbols
> for symbol in symbols:
>    f = f.subs(symbol, dummy)
>    f = f.subs(symbol, sympy.Symbol(symbol.name, positive=True))
>
>
> Now, when I do f.replace(log(a), log(Abs(a))) it shows log(x) as expected, 
> since x is positive
> Now, make inverse process: convert positive to any
>
> for symbol in symbols:
>    f = f.subs(symbol, dummy)
>    f = f.subs(symbol, sympy.Symbol(symbol.name))
>
> But f.replace(log(a), log(Abs(a))) shows log(x) and in debugger x is still 
> positive.
>
> Setting f.subs(symbol, sympy.Symbol(symbol.name, positive=None)) doesn't 
> help.
> Helps following:
> f.subs(symbol, sympy.Symbol(symbol.name, positive=False))
> But I don't want negative variable.
> How can I just reset assumptions?
>

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/300957bd-6491-4a70-98b1-1fe7edde327b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to