MAINT: Use uint8_t from numpy instead of stdint.h#295
Conversation
| cdef double[:, ::1] pts_view = pts | ||
| cdef double[:, ::1] poly_pts_view = poly_pts | ||
| cdef uint8_t[::1] results = np.zeros(len(pts), dtype=np.uint8) | ||
| cdef np.uint8_t[::1] results = np.zeros(len(pts), dtype=np.uint8) |
There was a problem hiding this comment.
Are you sure that shouldn't be np.npy_uint8?
There was a problem hiding this comment.
I think that magically transmogrifies to npy_uint8 somewhere deep under the Cython hood...
There was a problem hiding this comment.
There was a problem hiding this comment.
Indeed. Thanks for clearing that up
| @@ -1,5 +1,5 @@ | |||
| from libc.stdint cimport uint8_t | |||
| import numpy as np | |||
| cimport numpy as np | |||
There was a problem hiding this comment.
Style nit: I may be alone in this (certainly the Cython numpy tutorials do it like you do), but I don't like import numpy as np and cimport numpy as np. I usually cimport numpy as cnp to distinguish the later references.
Or in this case, since you are importing only one thing: from numpy cimport uint8_t
Either way, LGTM.
|
We should probably get AppVeyor hooked up for this project... |
Agreed, and same thing for Chaco. I ran into this issue (and a similar issue for Chaco) while trying to build Python 2.7 eggs on Windows... |
Codecov Report
@@ Coverage Diff @@
## master #295 +/- ##
======================================
Coverage 33.6% 33.6%
======================================
Files 206 206
Lines 18278 18278
Branches 2407 2407
======================================
Hits 6142 6142
Misses 11744 11744
Partials 392 392Continue to review full report at Codecov.
|
|
Thanks guys, merging. |
MAINT: Use uint8_t from numpy instead of stdint.h
Merge pull request #295 from enthought/maint/avoid-stdint-h
The Cython module
kiva._cython_speedupswas using the stdint.h header, which is not shipped with VS 2008 (needed for Python 2.7). This replaces it by the equivalent declaration from Numpy.