Interface cases function with SymPy's piecewise
rwst opened this issue · 16 comments
In #20191 the cases function is introduced. This ticket should interface it with SymPy's piecewise (both directions) and test with:
sage: _ = var('y, z')
sage: (x^y - z).integrate(y)
-y*z + x^y/log(x)
sage: (x^y - z).integrate(y, algorithm="sympy") # see Trac #14694
-y*z + cases(((log(x) == 0, y), (1, x^y/log(x))))
Depends on #20191
Depends on #23990
Depends on #24006
CC: @mforets @EmmanuelCharpentier
Component: interfaces
Author: Ralf Stephan
Branch/Commit: b261ec3
Reviewer: Emmanuel Charpentier
Issue created by migration from https://trac.sagemath.org/ticket/23923
Commit: ea10ee7
New commits:
ea10ee7 | 23923: interface cases() with SymPy |
Changed branch from u/rws/interface_cases_function_with_sympy_s_piecewise to u/rws/23923
Branch pushed to git repo; I updated commit sha1. New commits:
b80d98c | 23923: fix typo |
Author: Ralf Stephan
On top of 8.1beta7+#24026 + #24006(dependency) + #23990(dependency) + #23923(present patch), one permanent failure :
sage -t --long src/sage/symbolic/integration/integral.py
**********************************************************************
File "src/sage/symbolic/integration/integral.py", line 508, in sage.symbolic.int
egration.integral.integrate
Failed example:
(x^y - z).integrate(y, algorithm="sympy") # see Trac #14694
Expected:
Traceback (most recent call last):
...
AttributeError: 'ExprCondPair' object has no attribute '_sage_'
Got:
-y*z + cases(((log(x) == 0, y), (1, x^y/log(x))))
**********************************************************************
1 item had failures:
1 of 126 in sage.symbolic.integration.integral.integrate
[169 tests, 1 failure, 53.41 s]
==>needs_work. Probably a booboo, though...
Branch pushed to git repo; I updated commit sha1. New commits:
b261ec3 | 23923: fix doctest |
On top of 8.1beta8+#24026 + #24006(dependency) + #23990(dependency) + #23923(present patch), passes ptestlong with no error whatsoever.
==>positive_review
Notes :
- I rebased the test on the hust-issued 8.1.beta8
- I have kept #24026 (which
needs_review, BTW...) because removing it entails recompiling R (which is slow) and reinstall 442 R packages, (which is slower...).
Reviewer: Emmanuel Charpentier
Thanks. I've added your name, hope it's not impolite.
Changed branch from u/rws/23923 to b261ec3