#31873 closed enhancement (fixed)

use libgiac instead of giac for integration

Reported by: gh-mwageringel Owned by:
Priority: major Milestone: sage-9.5
Component: interfaces Keywords: giac, integration
Cc: slelievre Merged in:
Authors: Markus Wageringel Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: bb15f0f (Commits, GitHub, GitLab) Commit: bb15f0f3fa8e18801c23442ae73f8bb4fac36cf0
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-mwageringel)

Now that giacpy_sage has been included into Sage by #29171, we can use it for integration instead of the Pexpect interface. This ticket adds a libgiac_integrator which replaces the giac_integrator in the default integrator (which uses Maxima, Giac, and Sympy).

This will resolve issues like #28913 or this ask-sage question where the Pexpect output cannot be parsed by Sage because Giac prints warning messages to the output.

The libgiac_integrator behaves slightly different than the Pexpect-based integrator, in that warning messages issued by Giac are not stripped away anymore.

sage: integrate(abs(cos(x)), x, 0, 2*pi)
Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):
Check [abs(cos(x))]
Discontinuities at zeroes of cos(x) were not checked
4

These messages are generally useful in interactive use. For doctests, the current branch adjusts most of the tests so that they do not depend on the presence of these messages.

Due to the problem at #31655, the first doctest in a file that uses libgiac results in some additional messages, but again the tests are written so that this does not matter. If that ticket is resolved, the second commit could be mostly reverted, but this is not strictly necessary. With the default integrator, these Giac loading messages will appear on the first integral that Maxima cannot solve.

Part of meta-ticket #16688.

Change History (12)

comment:1 Changed 13 months ago by gh-mwageringel

  • Keywords giac added

comment:2 Changed 12 months ago by gh-mwageringel

  • Authors set to Markus Wageringel
  • Branch set to u/gh-mwageringel/31873
  • Commit set to e023915d4746b0d2bcf8753bd1747d7c2757a411
  • Description modified (diff)
  • Keywords integration added
  • Status changed from new to needs_review

New commits:

900ec8831873: replace giac by libgiac for integration
e02391531873: ignore Giac loading messages in doctests, see #31655

comment:3 Changed 12 months ago by git

  • Commit changed from e023915d4746b0d2bcf8753bd1747d7c2757a411 to a47a3604ae121eeb564c7bf41947fdf59c823fed

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

a47a36031873: fix pyflakes warnings

comment:4 Changed 12 months ago by git

  • Commit changed from a47a3604ae121eeb564c7bf41947fdf59c823fed to b591d2a768b662e2ea4af7a3bbd8ab7c8b12477f

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

b591d2aMerge tag '9.4.beta3' into #31873

comment:5 Changed 11 months ago by mkoeppe

  • Reviewers set to Matthias Koeppe
  • Status changed from needs_review to positive_review

LGTM

comment:6 Changed 11 months ago by gh-mwageringel

Thanks.

comment:7 Changed 11 months ago by vbraun

  • Status changed from positive_review to needs_work

test failures

sage -t --long --warn-long 45.1 --random-seed=0 src/sage/symbolic/integration/integral.py  # 2 doctests failed
sage -t --long --warn-long 45.1 --random-seed=0 src/doc/en/prep/Calculus.rst  # 1 doctest failed

comment:8 Changed 11 months ago by git

  • Commit changed from b591d2a768b662e2ea4af7a3bbd8ab7c8b12477f to bb15f0f3fa8e18801c23442ae73f8bb4fac36cf0

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

4481d50Merge tag '9.4.beta6' into #31873
bb15f0f31873: fix doctests

comment:9 Changed 11 months ago by gh-mwageringel

  • Status changed from needs_work to needs_review

I have fixed the doctests. Now this passes ptestlong again. Also, this does not conflict with #32275.

comment:10 Changed 11 months ago by mkoeppe

  • Status changed from needs_review to positive_review

comment:11 Changed 11 months ago by mkoeppe

  • Milestone changed from sage-9.4 to sage-9.5

comment:12 Changed 10 months ago by vbraun

  • Branch changed from u/gh-mwageringel/31873 to bb15f0f3fa8e18801c23442ae73f8bb4fac36cf0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.