#12801: substitute_function misses some substitutions
-----------------------------+----------------------------------------------
Reporter: nbruin | Owner: burcin
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-5.0
Component: symbolics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: #12796 | Stopgaps:
-----------------------------+----------------------------------------------
Changes (by mjo):
* dependencies: => #12796
Comment:
With #12796 done, the example works and I can add a doctest. My own code
needs to substitute functions that aren't built in, though:
{{{
sage: f = function('f')
sage: g = 2*x*sin(x)
sage: f_prime = f(x).diff(x)
sage: f_prime.substitute_function(f,g)
/home/mjo/src/sage-5.0.beta12/local/lib/python2.7/site-
packages/sage/symbolic/expression_conversions.py:1627: DeprecationWarning:
Substitution using function-call syntax and unnamed arguments is
deprecated and will be removed from a future release of Sage; you can use
named arguments instead, like EXPR(x=..., y=...)
return operator.change_function(self.new)(*map(self,ex.operands()))
2*x*cos(x) + 2*sin(x)
}}}
It does do the right thing, I just haven't been able to figure out how to
avoid the warning. Is there some way to get a real function out of the
expression `g`? Or a way to trick the substitution into doing e.g. `x=x`,
`y=y`?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12801#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en.