#23923 closed defect (fixed)

Interface cases function with SymPy's piecewise

Reported by: rws Owned by:
Priority: major Milestone: sage-8.1
Component: interfaces Keywords:
Cc: mforets, charpent Merged in:
Authors: Ralf Stephan Reviewers: Emmanuel Charpentier
Report Upstream: N/A Work issues:
Branch: b261ec3 (Commits) Commit: b261ec3e671179d04d1922d15d9116e4f6e1d47f
Dependencies: #20191, #23990, #24006 Stopgaps:

Description

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))))

Change History (12)

comment:1 Changed 20 months ago by rws

  • Dependencies changed from #20191 to #20191, #23990

comment:2 Changed 20 months ago by rws

  • Branch set to u/rws/interface_cases_function_with_sympy_s_piecewise

comment:3 Changed 20 months ago by charpent

  • Cc charpent added
  • Commit set to ea10ee716041295de353cbef6f21d6885c825178

New commits:

ea10ee723923: interface cases() with SymPy

comment:4 Changed 19 months ago by rws

  • Branch changed from u/rws/interface_cases_function_with_sympy_s_piecewise to u/rws/23923

comment:5 Changed 19 months ago by git

  • Commit changed from ea10ee716041295de353cbef6f21d6885c825178 to b80d98c2415f106f9f90270f1b0a7f9f240b76f4

Branch pushed to git repo; I updated commit sha1. New commits:

b80d98c23923: fix typo

comment:6 Changed 19 months ago by rws

  • Authors set to Ralf Stephan
  • Dependencies changed from #20191, #23990 to #20191, #23990, #24006
  • Status changed from new to needs_review

comment:7 Changed 19 months ago by charpent

  • Status changed from needs_review to needs_work

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...

comment:8 Changed 19 months ago by git

  • Commit changed from b80d98c2415f106f9f90270f1b0a7f9f240b76f4 to b261ec3e671179d04d1922d15d9116e4f6e1d47f

Branch pushed to git repo; I updated commit sha1. New commits:

b261ec323923: fix doctest

comment:9 Changed 19 months ago by rws

  • Status changed from needs_work to needs_review

comment:10 Changed 19 months ago by charpent

  • Status changed from needs_review to positive_review

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...).

comment:11 Changed 19 months ago by rws

  • Reviewers set to Emmanuel Charpentier

Thanks. I've added your name, hope it's not impolite.

comment:12 Changed 19 months ago by vbraun

  • Branch changed from u/rws/23923 to b261ec3e671179d04d1922d15d9116e4f6e1d47f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.