File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ Some are defined in the associated header file .pxd
32
32
33
33
__author__ = " Jerome Kieffer"
34
34
35
- __date__ = " 03/12/2018 "
35
+ __date__ = " 21/01/2019 "
36
36
__status__ = " stable"
37
37
__license__ = " MIT"
38
38
@@ -42,6 +42,12 @@ include "numpy_common.pxi"
42
42
# Imports at the Python level
43
43
import cython
44
44
import numpy
45
+ import sys
46
+
47
+ # Work around for issue similar to : https://github.com/pandas-dev/pandas/issues/16358
48
+
49
+ _numpy_1_12_py2_bug = ((sys.version_info.major == 2 ) and
50
+ ([1 , 12 ] <= [int (i) for i in numpy.version.version.split(" ." , 2 )[:2 ]]))
45
51
46
52
# Imports at the C level
47
53
from .isnan cimport isnan
@@ -66,10 +72,16 @@ ctypedef cnumpy.int8_t mask_t
66
72
mask_d = numpy.int8
67
73
68
74
# Type used for propagating variance
69
- prop_d = numpy.dtype([(' signal' , acc_d),
70
- (' variance' , acc_d),
71
- (' norm' , acc_d),
72
- (' count' , acc_d)])
75
+ if _numpy_1_12_py2_bug:
76
+ prop_d = numpy.dtype([(b' signal' , acc_d),
77
+ (b' variance' , acc_d),
78
+ (b' norm' , acc_d),
79
+ (b' count' , acc_d)])
80
+ else :
81
+ prop_d = numpy.dtype([(' signal' , acc_d),
82
+ (' variance' , acc_d),
83
+ (' norm' , acc_d),
84
+ (' count' , acc_d)])
73
85
74
86
ctypedef fused any_int_t:
75
87
cnumpy.uint8_t
You can’t perform that action at this time.
0 commit comments