How can one exclude species from being processed in a doit()

18 views
Skip to first unread message

Dzhelil Rufat

unread,
Oct 21, 2015, 10:18:47 PM10/21/15
to sympy
The documentation says:

doit(**hints)

Evaluate objects that are not evaluated by default like limits, integrals, sums and products. All objects of this kind will be evaluated recursively, unless some species were excluded via ‘hints’ or unless the ‘deep’ hint was set to ‘False’.


http://docs.sympy.org/0.7.1/modules/core.html#sympy.core.basic.Basic.doit

What is the correct way to exclude things from being processed in doit? Say in the expressions below

expr = ( Sum(k, (k, 0, 10)) + Integral(x, (x, 0, 2) ).doit()

I want doit to evaluate only the Integral and not the Sum. So that the result is equivalent to

expr = ( Sum(k, (k, 0, 10)) + Integral(x, (x, 0, 2).doit() )

Is there a way to do that?

Trying the obvious

expr.doit(Sum=False)

does not work.

Dzhelil

Aaron Meurer

unread,
Oct 22, 2015, 12:11:48 PM10/22/15
to sy...@googlegroups.com
This apparently isn't widely supported. The only one I found was
doit(integrals=False) disables integrals. It probably ought to use the
syntax you suggest.

Aaron Meurer
> --
> 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 sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> 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/556c7f9c-c15f-4db8-861d-c2425277c61f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages