Opened 8 years ago

Closed 6 years ago

#17493 closed defect (fixed)

bind SymPy's ComplexInfinity

Reported by: rws Owned by:
Priority: major Milestone: sage-7.2
Component: interfaces Keywords: unsigned infinity
Cc: Merged in:
Authors: Ralf Stephan Reviewers: Karl-Dieter Crisman, Marc Mezzarobba
Report Upstream: N/A Work issues:
Branch: 0ef8018 (Commits, GitHub, GitLab) Commit: 0ef801837e057af8cb436d427a1dfcae4980fe4f
Dependencies: #20185 Stopgaps:

Status badges

Description

sage: import sympy
sage: SR(sympy.factorial(-2))
---------------------------------------------------------------------------
...
AttributeError: 'ComplexInfinity' object has no attribute '_sage_'

Change History (26)

comment:1 Changed 8 years ago by rws

  • Branch set to u/rws/bind_sympy_s_complexinfinity

comment:2 Changed 8 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 3dccb4ed967b691cac2d3c51a687f8d2dfa84787

That would be all. However, I have no idea atm how to change sympify to convert to zoo.


New commits:

3dccb4e17493: add _sage_ method to ComplexInfinity
Version 0, edited 8 years ago by rws (next)

comment:3 Changed 8 years ago by git

  • Commit changed from 3dccb4ed967b691cac2d3c51a687f8d2dfa84787 to 7ca600ad4bd10ee2295d47ac505dacb61fc882bd

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

7ca600a17493: doctest

comment:4 Changed 8 years ago by git

  • Commit changed from 7ca600ad4bd10ee2295d47ac505dacb61fc882bd to 4928fa4b58f9aa301b9fb5942cdce04fa54e6a52

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

4928fa417493: remove unrelated patchfile

comment:5 Changed 8 years ago by rws

  • Keywords unsigned infinity added
  • Status changed from new to needs_review

comment:6 follow-up: Changed 8 years ago by kcrisman

  • Report Upstream changed from N/A to Not yet reported upstream; Will do shortly.

How does this one relate to #14723? I assume this is also part of your large upstream patch? I guess in principle this one can just depend on #14723 since the .p1 is correct if that one is .p0.

comment:7 in reply to: ↑ 6 Changed 8 years ago by rws

  • Dependencies set to #14723
  • Report Upstream changed from Not yet reported upstream; Will do shortly. to Completely fixed; Fix reported upstream

Replying to kcrisman:

How does this one relate to #14723? I assume this is also part of your large upstream patch? I guess in principle this one can just depend on #14723 since the .p1 is correct if that one is .p0.

Yes and yes. Github pull request: https://github.com/sympy/sympy/issues/8592

comment:8 Changed 8 years ago by kcrisman

I have to say I'm totally mystified as to why this is called zoo. Is this a pun?

Here is something we might as well take care of here. But the change here itself is fine and useful.

sage: a = oo
sage: b = -oo
sage: c = UnsignedInfinityRing.gen()  
# really, the easiest way?  probably should do better than that, not here
sage: a
+Infinity
sage: b
-Infinity
sage: c
Infinity
sage: a._sympy_()
oo
sage: b._sympy_()
-oo
sage: c._sympy_()
---------------------------------------------------------------------------
AttributeError: 'UnsignedInfinity' object has no attribute '_sympy_'

A nice test for that would be

gamma(-3)._sympy_() is sympy.factorial(-2)
gamma(-3) is sympy.factorial(-2)._sage_()

(note that putting it in SR makes it == but not is).

comment:9 Changed 7 years ago by kcrisman

  • Reviewers set to Karl-Dieter Crisman
  • Status changed from needs_review to needs_work

We really should have both directions on this ticket, I think.

comment:10 Changed 7 years ago by git

  • Commit changed from 4928fa4b58f9aa301b9fb5942cdce04fa54e6a52 to 27e2fc707687c7c55434608464952075be7a3b25

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

1aff5f2Merge branch 'develop' into t/17493/bind_sympy_s_complexinfinity
27e2fc717493: add unsigned_infinity conversion to sympy

comment:11 Changed 7 years ago by rws

  • Status changed from needs_work to needs_review

Ah it was easier than thought.

comment:12 Changed 7 years ago by kcrisman

Ah it was easier than thought.

That's why I asked, otherwise it would have been a separate ticket for sure. I'll get to this today for sure.

comment:13 Changed 7 years ago by kcrisman

  • Branch changed from u/rws/bind_sympy_s_complexinfinity to u/kcrisman/ticket/17493
  • Commit changed from 27e2fc707687c7c55434608464952075be7a3b25 to a514394ee5045c5d3a06968ba2d00d0bb179f7ae
  • Status changed from needs_review to positive_review

New commits:

a514394Reviewer patch

comment:14 Changed 7 years ago by mmezzarobba

Conflicts with #14723

comment:15 Changed 7 years ago by rws

Resolved in #14723.

comment:16 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-6.5 to sage-pending

comment:17 Changed 7 years ago by vbraun

  • Resolution set to duplicate
  • Status changed from positive_review to closed

comment:18 Changed 7 years ago by vbraun

  • Resolution duplicate deleted
  • Status changed from closed to new

comment:19 Changed 7 years ago by vbraun

  • Status changed from new to needs_review

comment:20 Changed 7 years ago by vbraun

  • Status changed from needs_review to positive_review

comment:21 Changed 7 years ago by vbraun

Sorry, misunderstood the last comment.

Whats up with the dependency?

PSA: sage-pending tickets are not getting merged

comment:22 Changed 7 years ago by rws

The dependency is pending (because there is still no new SymPy? release---0.7.6.1 is just a quick fix of Jupyter stuff) so this is pending, too.

comment:23 Changed 6 years ago by rws

  • Branch changed from u/kcrisman/ticket/17493 to public/17493

comment:24 Changed 6 years ago by rws

  • Commit changed from a514394ee5045c5d3a06968ba2d00d0bb179f7ae to 0ef801837e057af8cb436d427a1dfcae4980fe4f
  • Dependencies changed from #14723 to #20185
  • Milestone changed from sage-pending to sage-7.2
  • Report Upstream changed from Completely fixed; Fix reported upstream to N/A
  • Status changed from positive_review to needs_review

New commits:

f89b9e8Merge branch 'u/kcrisman/ticket/17493' of git://trac.sagemath.org/sage into i17493
0ef8018remove now unnecessary patch

comment:25 Changed 6 years ago by mmezzarobba

  • Reviewers changed from Karl-Dieter Crisman to Karl-Dieter Crisman, Marc Mezzarobba
  • Status changed from needs_review to positive_review

comment:26 Changed 6 years ago by vbraun

  • Branch changed from public/17493 to 0ef801837e057af8cb436d427a1dfcae4980fe4f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.