Updates:
Summary: guessing what functions, like integrate, roots, factor, apart
(and many more), should do with the given expression
Status: Started
Labels: Milestone-Release0.7.0
Comment #6 on issue 527 by mattpap: guessing what functions, like
integrate, roots, factor, apart (and many more), should do with the given
expression
http://code.google.com/p/sympy/issues/detail?id=527
The current state of art is as follows:
1. Simplification functions --- expand(), simplify(), together() (...) ---
here symbols aren't important and all functions accept only a single
expression as input (the API is fairly uniform).
2. Polynomials manipulation functions --- factor(), cancel(), div(), gcd()
(...) --- symbols are important, but can be easily derived by those
functions, however the user can specify symbols explicitly. Most functions
allow the following two calling conventions:
function(expr_0, ..., expr_n, *gens, **args)
function(expr_0, ..., expr_n, (gen_0, ..., gen_k), **args)
(i.e. generators can be passed as star args or as a tuple)
There are a few exceptions to this rule. The most notable are intervals()
and nroots(). In the case of those functions, only univariate polynomials
with numeric coefficients are supported so, there is no need to specify
generators. Note that roots() is different, because domain may be
composite, although a polynomial is univariate.
3. Other functions --- diff(), integrate(), sum(), product(), limit(),
series(), (...?) --- here we have to always specify symbols, except
integrate(). It seems, however, appealing to allow at least diff(x**2 - 1)
in the univariate case (would use atoms() to collect symbols) (btw.
integrate() works as well in the multivariate case).
In diff() case we currently have:
In [1]: diff(x**2 - 1)
(...)
IndexError: tuple index out of range
So, even if we won't allow this syntax in future, then at least the error
message should be a little bit more informative.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.