Opened 2 years ago

Closed 19 months ago

#22566 closed defect (fixed)

SymPy's ceiling() is not translated to Sage

Reported by: pelegm Owned by:
Priority: major Milestone: sage-8.1
Component: calculus Keywords: ceil, integrate, sympy
Cc: Merged in:
Authors: Ralf Stephan Reviewers: Marcelo Forets
Report Upstream: N/A Work issues:
Branch: 319c8b9 (Commits) Commit: 319c8b9f09511efbe75c851a85c8221dd58c1c5b
Dependencies: #23923 Stopgaps:

Description (last modified by rws)

sage: ceil(x)
ceil(x)
sage: _._sympy_()
ceiling(x)
sage: _._sage_()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-9-7149a2430cab> in <module>()
----> 1 _._sage_()

/home/ralf/sage/local/lib/python2.7/site-packages/sympy/core/function.py in _sage_(self)
    705         import sage.all as sage
    706         fname = self.func.__name__
--> 707         func = getattr(sage, fname)
    708         args = [arg._sage_() for arg in self.args]
    709         return func(*args)

AttributeError: 'module' object has no attribute 'ceiling'
sage: 

Previous description was:

sage: integrate(ceil(x), x, 0, infinity, algorithm='sympy')

leads to

Traceback (most recent call last):
  File "<ipython-input-3-257ec54e6dd3>", line 1, in <module>
    integrate(ceil(x), x, Integer(0), infinity, algorithm='sympy')
  File "/home/peleg/sage/local/lib/python2.7/site-packages/sage/misc/functional.py", line 664, in integral
    return x.integral(*args, **kwds)
  File "sage/symbolic/expression.pyx", line 11766, in sage.symbolic.expression.Expression.integral (build/cythonized/sage/symbolic/expression.cpp:65026)
    return integral(self, *args, **kwds)
  File "/home/peleg/sage/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py", line 773, in integrate
    return integrator(expression, v, a, b)
  File "/home/peleg/sage/local/lib/python2.7/site-packages/sage/symbolic/integration/external.py", line 42, in sympy_integrator
    return result._sage_()
  File "/home/peleg/sage/local/lib/python2.7/site-packages/sympy/integrals/integrals.py", line 1100, in _sage_
    f, limits = self.function._sage_(), list(self.limits)
  File "/home/peleg/sage/local/lib/python2.7/site-packages/sympy/core/function.py", line 707, in _sage_
    func = getattr(sage, fname)
AttributeError: 'module' object has no attribute 'ceiling'

Change History (7)

comment:1 Changed 2 years ago by rws

  • Description modified (diff)
  • Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.
  • Summary changed from Integrate ceil(x) via sympy raises an AttributeError to SymPy's ceiling() is not translated to Sage

This has to be fixed in SymPy. This ticket should monitor progress and commit a doctest.

comment:2 Changed 19 months ago by rws

  • Branch set to u/rws/22566

comment:3 Changed 19 months ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 2afa0ee105e99e3b7c8185c8d7b4721a9b4d7c86
  • Dependencies set to #23923
  • Milestone changed from sage-7.6 to sage-8.1
  • Report Upstream changed from Not yet reported upstream; Will do shortly. to N/A
  • Status changed from new to needs_review

Last 10 new commits:

07f474423990: handle unequality
0ed659f23990: do not evaluate
5f023ea23990: convert relations from SymPy to Sage, with test
0f596bb23990: fix patch
479e20623990: sympy patchlevel bump
3e362ee24006: SymPy --> Sage conversion completely inside Sage
8dd5f8824006: add missing file, fixes
a68d57f23923: Interface cases function with SymPy's piecewise
b80d98c23923: fix typo
2afa0ee22566: interface SymPy's ceiling()

comment:4 Changed 19 months ago by git

  • Commit changed from 2afa0ee105e99e3b7c8185c8d7b4721a9b4d7c86 to 9494f6cc69630d3af9567c1179e56a0a62af736d

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

9494f6c22566: add test

comment:5 Changed 19 months ago by git

  • Commit changed from 9494f6cc69630d3af9567c1179e56a0a62af736d to 319c8b9f09511efbe75c851a85c8221dd58c1c5b

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

b261ec323923: fix doctest
319c8b9Merge branch 'u/rws/23923' of git://trac.sagemath.org/sage into t/22566/22566

comment:6 Changed 19 months ago by mforets

  • Reviewers set to Marcelo Forets
  • Status changed from needs_review to positive_review

LGTM.

comment:7 Changed 19 months ago by vbraun

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