Skip to content

Commit d5283b0

Browse files
committed
get sqrt from util
1 parent 703a54b commit d5283b0

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

pandas/_libs/algos.pyx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ cdef double NaN = <double> np.NaN
2828
cdef double nan = NaN
2929

3030
from libc.math cimport fabs
31-
cdef extern from "src/headers/math.h":
32-
# use this version instead of `from libc.math cimport sqrt`; see GH#18420
33-
double sqrt(double x) nogil
3431

3532
# this is our util.pxd
36-
from util cimport numeric, get_nat
33+
from util cimport numeric, get_nat, sqrt
3734

3835
import missing
3936

pandas/_libs/lib.pyx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,9 @@ from missing cimport checknull
6565

6666
cimport util
6767
cdef int64_t NPY_NAT = util.get_nat()
68-
from util cimport is_array, _checknull
68+
from util cimport is_array, _checknull, sqrt
6969

7070
from libc.math cimport fabs
71-
cdef extern from "src/headers/math.h":
72-
# use this version instead of `from libc.math cimport sqrt`; see GH#18420
73-
double sqrt(double x) nogil
7471

7572

7673
def values_from_object(object o):

pandas/_libs/src/util.pxd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ from numpy cimport ndarray
22
cimport numpy as cnp
33
cimport cpython
44

5+
6+
cdef extern from "headers/math.h":
7+
# use this version instead of `from libc.math cimport sqrt`; see GH#18420
8+
double sqrt(double x) nogil
9+
10+
511
cdef extern from "numpy_helper.h":
612
void set_array_not_contiguous(ndarray ao)
713

pandas/_libs/window.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ cdef double NaN = <double> np.NaN
3232
cdef inline int int_max(int a, int b): return a if a >= b else b
3333
cdef inline int int_min(int a, int b): return a if a <= b else b
3434

35-
from util cimport numeric
35+
from util cimport numeric, sqrt
3636

3737
cdef extern from "../src/headers/math.h":
3838
int signbit(double) nogil
39-
double sqrt(double x) nogil
40-
# use this version instead of `from libc.math cimport sqrt`; see GH#18420
4139

4240

4341
# Cython implementations of rolling sum, mean, variance, skewness,

0 commit comments

Comments
 (0)