11# cython: profile=False
22
3- from numpy cimport *
43cimport numpy as np
54import numpy as np
65
76cimport cython
7+ from cython cimport Py_ssize_t
88
9- import_array()
9+ np. import_array()
1010
1111cdef float64_t FP_ERR = 1e-13
1212
@@ -15,31 +15,19 @@ cimport util
1515from libc.stdlib cimport malloc, free
1616from libc.string cimport memmove
1717
18- from numpy cimport NPY_INT8 as NPY_int8
19- from numpy cimport NPY_INT16 as NPY_int16
20- from numpy cimport NPY_INT32 as NPY_int32
21- from numpy cimport NPY_INT64 as NPY_int64
22- from numpy cimport NPY_FLOAT16 as NPY_float16
23- from numpy cimport NPY_FLOAT32 as NPY_float32
24- from numpy cimport NPY_FLOAT64 as NPY_float64
25-
26- from numpy cimport (int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
27- uint32_t, uint64_t, float16_t, float32_t, float64_t)
28-
29- int8 = np.dtype(np.int8)
30- int16 = np.dtype(np.int16)
31- int32 = np.dtype(np.int32)
32- int64 = np.dtype(np.int64)
33- float16 = np.dtype(np.float16)
34- float32 = np.dtype(np.float32)
35- float64 = np.dtype(np.float64)
18+ from numpy cimport (ndarray,
19+ NPY_INT64, NPY_UINT64, NPY_INT32, NPY_INT16, NPY_INT8,
20+ NPY_FLOAT32, NPY_FLOAT64,
21+ NPY_OBJECT,
22+ int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
23+ uint32_t, uint64_t, float16_t, float32_t, float64_t,
24+ double_t)
25+
3626
3727cdef double NaN = < double > np.NaN
3828cdef double nan = NaN
3929
40- cdef extern from " ../src/headers/math.h" :
41- double sqrt(double x) nogil
42- double fabs(double ) nogil
30+ from libc.math cimport sqrt, fabs
4331
4432# this is our util.pxd
4533from util cimport numeric, get_nat
0 commit comments