[email protected] wrote: > Dear developer of cython, > > First of all I thank you for all your work. Thanks to Cython and the > documentation and tutorial that you displayed on internet, I have > successfully managed to create a cython code approximately 250 times > quicker than with python and even 1.4times quicker than C. > > In fact I created two cython codes corresponding to two python codes of > the same algorithm (one with a single function and one with several > classes and function). > > I hesitated several minutes before posting in this list or in the user > list but since this is not simple cython problem but a problem with the > new version of cython, i have finally chosen to post here. I hope I made > the right choice. > > I downloaded the version 0.13 of cython yesterday (I was previously using > the version 0.12.1) and two problems appeared when I used cython. > > The first one is that it seems that we can no more combine cpdef and > decorator : > > @cython.boundscheck(False) > @cython.wraparound(False) > cpdef run(self,adjacencyMatrix_,nodesPosition_,int dimension,nbLink_): > ^ > ------------------------------------------------------------ > > /homelocal/max/Memoire/Sources/CAttractionRepulsionAlgorithm.pyx:48:4: > Decorators can only be followed by functions > > I have the same problem with cdef and I have not the problem with def. > This is a bug. Thanks for reporting, filed at http://trac.cython.org/cython_trac/ticket/522.
In the meantime, you can use declarations such as np.ndarray[int, ndim=2, negative_indices=False] for the same effect. > The second problem is that it seems that we can nore more used > @cython.wraparound(False). > I have this error > > @cython.wraparound(False) > ^ > ------------------------------------------------------------ > > /homelocal/max/Memoire/Sources/CAttractionRepulsionAlgorithm.pyx:47:4: > 'wraparound' not a valid cython attribute or is being used incorrectly > > and this error for the same line : > > @cython.wraparound(False) > ^ > ------------------------------------------------------------ > > /homelocal/max/Memoire/Sources/CAttractionRepulsionAlgorithm.pyx:47:4: > 'wraparound' not a valid cython language construct > I do not understand you. Can you provide some more context (some more lines around where this happened, or an entire file which is as small as possible but reproduce the error). Are you sure you remembered to "cimport cython"? Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
