Opened 5 years ago

Closed 5 years ago

SymPy's ceiling() is not translated to Sage

Reported by: Owned by: pelegm major sage-8.1 calculus ceil, integrate, sympy Ralf Stephan Marcelo Forets N/A 319c8b9 319c8b9f09511efbe75c851a85c8221dd58c1c5b #23923

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

```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'
```

comment:1 Changed 5 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 5 years ago by rws

• Branch set to u/rws/22566

comment:3 Changed 5 years 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:

 ​07f4744 `23990: handle unequality` ​0ed659f `23990: do not evaluate` ​5f023ea `23990: convert relations from SymPy to Sage, with test` ​0f596bb `23990: fix patch` ​479e206 `23990: sympy patchlevel bump` ​3e362ee `24006: SymPy --> Sage conversion completely inside Sage` ​8dd5f88 `24006: add missing file, fixes` ​a68d57f `23923: Interface cases function with SymPy's piecewise` ​b80d98c `23923: fix typo` ​2afa0ee `22566: interface SymPy's ceiling()`

comment:4 Changed 5 years ago by git

• Commit changed from 2afa0ee105e99e3b7c8185c8d7b4721a9b4d7c86 to 9494f6cc69630d3af9567c1179e56a0a62af736d

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

 ​9494f6c `22566: add test`

comment:5 Changed 5 years ago by git

• Commit changed from 9494f6cc69630d3af9567c1179e56a0a62af736d to 319c8b9f09511efbe75c851a85c8221dd58c1c5b

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

 ​b261ec3 `23923: fix doctest` ​319c8b9 `Merge branch 'u/rws/23923' of git://trac.sagemath.org/sage into t/22566/22566`

comment:6 Changed 5 years ago by mforets

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

LGTM.

comment:7 Changed 5 years 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.