Hi cython devs,
I got the "unable to find vcvarsall.bat" error when using cython_inline when
trying to compile with mingw. Using cython normally (creating a setup.py file)
worked fine however.
I was able to fix the problem for me by changing inline.py to parse the config
files before building t
Is this a bug?
The following code fails to compile on windows VS2012, 32bit Python2.7 with a
recent 0.19-pre github cython:
cimport cython
ctypedef fused char_or_float:
cython.char
cython.float
cdef class FusedExample:
def __init__(self, char_or_float x):
pass
#
Resu
Robert Bradshaw writes:
>
> Yes, this is a bug; there is a bad interaction between fused types and
> special methods.
>
> I created http://trac.cython.org/cython_trac/ticket/802
>
Thanks for following up. My actual use-case was to allow either 1D or 2D
MemoryView inputs to a function by simpl
With the following code I get a "No matching signature found" error.
Is this a bug?
```
%%cython
cimport cython
ctypedef fused floating:
cython.double
cython.float
def nosignature(floating[:] x, floating[:] myarray = None):
print myarray is None
return x
```
In [39]: nosignatur
The following works:
```
%%cython
cimport cython
import numpy as np
cimport numpy as np
def f(double[:,:] arr):
cdef double[:] res = np.zeros(2*arr.size, dtype=np.float64)
cdef double[:] tmp
tmp = &arr[0,0]
res[:arr.size] = tmp
return res
```
whereas the following:
```
%%cyt
Using the following test code:
import numpy as np
from lapack import dgelsy
from numpy.linalg import lstsq
A = np.array([[ 0.12, -8.19, 7.69, -2.26, -4.71],
[-6.91, 2.22, -5.12, -9.08, 9.96],
[-3.33, -8.94, -6.72, -4.4 , -9.98],
[ 3.97, 3.33, -2.74, -7.92, -3.2 ]])
#
b =
%%cython
cimport cython
import numpy as np
cimport numpy as np
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.cdivision(True)
cpdef double[:] return_one(double[:] x):
return np.array([1.0])
In [43]: x = randn(3)
...: return_one(x)
Out[43]:
In [44]: x.flags['WRITEABLE'] =
Dave Hirschfeld writes:
>
> cpdef double[:] return_one(double[:] x):
> return np.array([1.0])
>
> In [43]: x = randn(3)
> ...: return_one(x)
> Out[43]:
>
> In [44]: x.flags['WRITEABLE'] = False
> ...: return_one(x)
> ValueError: buffer
Dave Hirschfeld writes:
>
> Using the following test code:
>
> So, it seems either typing the array as a memview or printing res
> will screw up the calculation.
>
> The cython code is given below. Any ideas if this is a cython bug or
> something
> I'm
Dave Hirschfeld writes:
>
> Dave Hirschfeld writes:
>
> >
> > Using the following test code:
>
> >
> > So, it seems either typing the array as a memview or printing res
> > will screw up the calculation.
> >
> > The cython cod
%%cython
cimport cython
import numpy as np
cimport numpy as np
ctypedef np.float64_t float64_t
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.cdivision(True)
def echo_numpy(np.ndarray[float64_t, ndim=1] x):
return x
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.
Sturla Molden writes:
>
> On 27.02.2013 20:05, Dave Hirschfeld wrote:
>
> > Is this a required restriction? Is there any workaround?
>
> http://www.python.org/dev/peps/pep-3118/
>
> What you should consider is the "readonly" field in "struct bufferin
Dag Sverre Seljebotn writes:
>
> cdef np.ndarray[double, mode='fortran'] arr
>
> that relies on PEP 3118 contiguous-flags and I did no checking myself.
> Lots of Cython code does this instead of memoryviews (I still write my
> own code that way).
>
> The memory views OTOH does their own chec
When trying to use strcasecmp from libc.string I get an error compiling with
msvc:
error C3861: 'strcasecmp': identifier not found
It seems MS have decided to call it by another name - _stricmp
...amongst others:
http://botsikas.blogspot.co.uk/2011/12/strcasecmp-identifier-not-found-
when.htm
Stefan Behnel writes:
>
> David Hirschfeld, 29.04.2013 11:58:
> > Forwarded because attachments were too large. The source files and
> > generated .c file can now be viewed at:
> > https://gist.github.com/dhirschfeld/5480711
> >
> > Is this a bug or is the recommendation to not build with -O3?
Sturla Molden writes:
>
> "Leon Bottou" wrote:
>
> > I am making heavy uses of OpenBlas which also uses OpenMP.
> > Using the same queue manager prevents lots of CPU provisioning problem.
> > Using multiple queue managers in the same code does not work as well
because
> > they are not aware o
It appears that you can't assign an ndarray to a memoryview slice? Is
this correct/expected behaviour?
Whilst there are a couple of possible workarounds it would be nice if
this just worked as it's a slightly surprising deviation from the
ndarray behaviour.
Broken example:
```
In [3]: %%cython
Dave Hirschfeld writes:
>
> It appears that you can't assign an ndarray to a memoryview slice? Is
> this correct/expected behaviour?
>
> Whilst there are a couple of possible workarounds it would be nice if
> this just worked as it's a slightly surprising d
18 matches
Mail list logo