Issue 3102 in sympy: Piecewise subs of function fails

0 views
Skip to first unread message

sy...@googlecode.com

unread,
Feb 25, 2012, 12:04:46 AM2/25/12
to sympy-...@googlegroups.com
Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium NeedsReview smichr

New issue 3102 by smi...@gmail.com: Piecewise subs of function fails
http://code.google.com/p/sympy/issues/detail?id=3102

g = Function('g')
h = Function('h')
p = Piecewise((g, x < -1), (g(x), x <= 1))

This fails with a TypeError.

This is corrected in https://github.com/sympy/sympy/pull/690

sy...@googlecode.com

unread,
Feb 25, 2012, 3:45:26 AM2/25/12
to sympy-...@googlegroups.com

Comment #1 on issue 3102 by asme...@gmail.com: Piecewise subs of function
fails
http://code.google.com/p/sympy/issues/detail?id=3102

I take it you wanted to do something else too. That alone doesn't fail,
and you're not using the h you defined.

Anyway, if something with a bare Function fails, it's not surprising, as
this does not really make sense.

sy...@googlecode.com

unread,
Feb 25, 2012, 6:52:58 AM2/25/12
to sympy-...@googlegroups.com

Comment #2 on issue 3102 by smi...@gmail.com: Piecewise subs of function
fails
http://code.google.com/p/sympy/issues/detail?id=3102

sorry, p.subs(g, h). I thought it didn't make sense, either, but such a
piecewise could be used to select the function that you want to apply, I
think. Imagine that the g(x) were replaced with f (another
UndefinedFunction).

sy...@googlecode.com

unread,
Feb 25, 2012, 5:37:28 PM2/25/12
to sympy-...@googlegroups.com

Comment #3 on issue 3102 by asme...@gmail.com: Piecewise subs of function
fails
http://code.google.com/p/sympy/issues/detail?id=3102

I disagree. Unless we can get this kind of thing to work generically
(issue 2006), we shouldn't pretend that it works at all.

sy...@googlecode.com

unread,
Mar 17, 2012, 1:14:24 AM3/17/12
to sympy-...@googlegroups.com
Updates:
Status: Fixed

Comment #4 on issue 3102 by smi...@gmail.com: Piecewise subs of function
fails
http://code.google.com/p/sympy/issues/detail?id=3102

replacement of functions doesn't fail now.

Reply all
Reply to author
Forward
0 new messages