Skip to content

Commit d017e7e

Browse files
committed
Windows vc9 friendly version
1 parent ec72897 commit d017e7e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

stratify/_vinterp.pyx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ cimport numpy as np
88
cimport cython
99

1010

11+
cdef extern from "numpy/npy_math.h" nogil:
12+
bint isnan "npy_isnan"(long double)
13+
float NAN "NPY_NAN"
14+
float INFINITY "NPY_INFINITY"
15+
16+
1117
cdef extern from "math.h" nogil:
12-
bint isnan(long double)
13-
float INFINITY
14-
float NAN
1518
double fabs(double z)
1619

1720

@@ -177,8 +180,8 @@ cdef class Interpolator(object):
177180
Parameters:
178181
----------
179182
i (unsigned int) - the current (upper) index along z_src. 0 <= i < z_src.size[0]
180-
i will only ever be 0 if z_src[i] == current_level.
181-
the interpolation value may lie on exactly i, but will never lie on exactly i-1.
183+
i will only ever be 0 if z_src[i] == current_level.
184+
the interpolation value may lie on exactly i, but will never lie on exactly i-1.
182185
z_src (double array) - the 1d column of z_src values.
183186
fz_src (2d double array) - the m 1d columns of fz_src values.
184187
fz_src.shape[1] == z_src.shape[0].
@@ -288,13 +291,13 @@ cdef class PyFuncInterpolator(Interpolator):
288291

289292

290293
cdef class Extrapolator(object):
291-
cdef long kernel(self, int direction,
294+
cdef long kernel(self, int direction,
292295
double[:] z_src, double[:, :] fz_src,
293296
double current_level, double[:] fz_target
294297
) nogil except -1:
295298
"""
296299
Defines the inner part of an extrapolation operation.
297-
300+
298301
Parameters:
299302
----------
300303
direction (int) - -1 for the bottom edge, +1 for the top edge
@@ -610,7 +613,7 @@ cdef class _Interpolation(object):
610613
z_src_indexer = [0] * z_src.ndim
611614
z_src_indexer[zp_axis] = slice(0, 2)
612615
first_two = z_src[z_src_indexer]
613-
rising = first_two[0] <= first_two[1]
616+
rising = first_two[0] <= first_two[1]
614617

615618
self.rising = bool(rising)
616619

0 commit comments

Comments
 (0)