Opened 10 years ago
Closed 7 years ago
#13386 closed defect (duplicate)
comparison of Sage integer with Numpy integer
Reported by: | vdelecroix | Owned by: | vdelecroix |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | basic arithmetic | Keywords: | integer, numpy, comparison |
Cc: | Merged in: | ||
Authors: | Reviewers: | Jeroen Demeyer | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
We correct
sage: import numpy sage: numpy.int32(123) == 123 True sage: 123 == numpy.int32(123) False
The change causes numpy to be loaded on startup. It may be hard to not do it as there are many integer comparisons on startup (see see nbruin comment).
Attachments (2)
Change History (14)
Changed 10 years ago by
comment:1 Changed 10 years ago by
- Status changed from new to needs_review
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
- Dependencies set to #11714
- Description modified (diff)
comment:4 Changed 9 years ago by
- Status changed from needs_review to needs_info
I claim "needs info" since it isn't clear that we want to go back to importing numpy on startup if a lot of work went into that ticket.
Changed 9 years ago by
comment:5 Changed 9 years ago by
I just added a patch, which avoids the loading of numpy during startup.
Unfortunately comparison with numpy types fail for all rings:
sage: import numpy sage: QQ(1) == numpy.int32(1) False sage: QQbar(1) == numpy.int32(1) False sage: AA(1) == numpy.int32(1) False sage: RR(1) == numpy.int32(1) False sage: RDF(1) == numpy.int32(1) False sage: RIF(1) == numpy.int32(1) False
comment:6 Changed 9 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:7 Changed 8 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:8 Changed 8 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:9 Changed 8 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:10 Changed 7 years ago by
- Dependencies #11714 deleted
- Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
- Status changed from needs_info to needs_review
Hello,
I propose to close this as duplicate since #18076 fixes the issue
sage: import numpy sage: 123 == numpy.int32(123) True
Vincent
comment:11 Changed 7 years ago by
- Reviewers set to Jeroen Demeyer
- Status changed from needs_review to positive_review
comment:12 Changed 7 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Your patch causes numpy to be loaded upon sage startup. According to #11714 that isn't done.