Opened 13 years ago

Closed 13 years ago

#2156 closed defect (fixed)

[with spkg, with positive review] Cython

Reported by: robertwb Owned by: mabshoff
Priority: major Milestone: sage-2.10.2
Component: packages: standard Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Get the spkg in

sage -ba; sage -testall works on intel OS X 10.4.

The most significant change is more flexible c(p)def functions and overriding. Specifically, c(p)def functions can now:

  • have optional arguments (which may grow)
  • be defined in the module scope
  • are always cimport-able if defined in the .pxd (i.e. "api" by default)
  • declare narrower return types than the superclass
  • cpdef can override cdef

There are also better conversions (<type?> does a type-checked cast, <int>x does the right thing), and numerous optimizations (especially with regard to tuple unpacking) and bugfixes.

Attachments (1)

2156-tripledict.patch (1.9 KB) - added by robertwb 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by mabshoff

  • Summary changed from [with spkg, needs review] Cython to [with spkg, with negative review] Cython

Two things

  • the name of the spkg needs to be lower case, i.e. Cython vs. cython
  • A sage -ba works fine on sage.math, but upon startup I get:
    mabshoff@sage:/scratch/mabshoff/release-cycle/sage-2.10.2.alpha0$ ./sage
    | SAGE Version 2.10.1, Release Date: 2008-02-02                      |
    | Type notebook() for the GUI, and license() for information.        |
    <type 'exceptions.TypeError'>             Traceback (most recent call last)
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/bin/<ipython console> in <module>()
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/lib/python2.5/site-packages/sage/ in <module>()
         12 try:
    ---> 14     from sage.all import *
         15     from sage.calculus.predefined import x
         16     preparser(on=True)
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/lib/python2.5/site-packages/sage/ in <module>()
         59 get_sigs()
    ---> 61 from sage.rings.all      import *
         62 from sage.matrix.all     import *
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/lib/python2.5/site-packages/sage/rings/ in <module>()
         91 # Algebraic numbers
    ---> 92 from qqbar import (AlgebraicRealField, is_AlgebraicRealField, AA,
         93                    AlgebraicReal, is_AlgebraicReal,
         94                    AlgebraicField, is_AlgebraicField, QQbar,
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/lib/python2.5/site-packages/sage/rings/ in <module>()
    -> 4040 RR_1_10 = RR(ZZ(1)/10)
       4041 QQ_0 = QQ(0)
       4042 QQ_1 = QQ(1)
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/bin/element.pyx in sage.structure.element.RingElement.__div__()
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/bin/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op_c()
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/bin/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.get_action_c()
    /scratch/mabshoff/release-cycle/sage-2.10.2.alpha0/local/bin/coerce_dict.pyx in sage.structure.coerce_dict.TripleDict.get()
    <type 'exceptions.TypeError'>: 'sage.rings.integer_ring.IntegerRing_class' object cannot be interpreted as an index



comment:2 Changed 13 years ago by robertwb

Changing the case is easy enough. I'll look into what's going wrong on sage.math.

comment:3 Changed 13 years ago by mabshoff

About the case: sure, I ended up doing that when I looked into the spkg and made sure there was no "junk" in it due to the increased size.

An interesting data point: After installing the old cython.spkg ( and doing a sage -ba I still go the same error. Only after deleting the installed Cython in site-packages, doing another install of and then sage -ba did the error disappear.



comment:4 Changed 13 years ago by robertwb

I thing the above may be a case issue (cython didn't overwrite Cython) but I know what the issue is--there's a patch that needs to be installed because <int>x no longer returns the address of x (which is used in coerce_dict.TripleDict.get().

Changed 13 years ago by robertwb

comment:5 Changed 13 years ago by robertwb

  • Summary changed from [with spkg, with negative review] Cython to [with spkg, needs review] Cython

I've uploaded a new spkg with a lowercase 'c' to the same directory as before. With the attached patch, things should work fine.

comment:6 Changed 13 years ago by mabshoff

  • Summary changed from [with spkg, needs review] Cython to [with spkg, with positive review] Cython

Good news: the updated spkg and the additional patch make sage start after a sage -ba. Ergo positive review, running -testall to make sure everything is still working.



comment:7 Changed 13 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged in Sage 2.10.2.alpha0

Note: See TracTickets for help on using tickets.