8000 MNT Removing Cython compilation warnings in WeightVector template (#2… · scikit-learn/scikit-learn@0b57005 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b57005

Browse files
jjerphanlorentzenchrthomasjpfan
authored
MNT Removing Cython compilation warnings in WeightVector template (#20739)
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
1 parent 21eb468 commit 0b57005

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

sklearn/utils/_weight_vector.pxd.tp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ dtypes = [('64', 'double'),
1818

1919
}}
2020

21+
# WARNING: Do not edit this .pyx file directly, it is generated from its .pyx.tp
2122
cimport numpy as np
2223

2324
{{for name_suffix, c_type in dtypes}}
2425

25-
cdef extern from "math.h":
26-
cdef extern {{c_type}} sqrt({{c_type}} x)
27-
28-
2926
cdef class WeightVector{{name_suffix}}(object):
3027
cdef readonly {{c_type}}[::1] w
3128
cdef readonly {{c_type}}[::1] aw

sklearn/utils/_weight_vector.pyx.tp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,24 @@ dtypes = [('64', 'double', 1e-9),
1818

1919
}}
2020

21+
# cython: language_level=3
2122
# cython: cdivision=True
2223
# cython: boundscheck=False
2324
# cython: wraparound=False
25+
# cython: profile=False
26+
# cython: linetrace=False
27+
# cython: initializedcheck=False
28+
# cython: binding=False
29+
# distutils: define_macros=CYTHON_TRACE_NOGIL=0
2430
#
2531
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
2632
# Lars Buitinck
2733
# Danny Sullivan <dsullivan7@hotmail.com>
2834
#
2935
# License: BSD 3 clause
3036

37+
# WARNING: Do not edit this .pyx file directly, it is generated from its .pyx.tp
38+
3139
cimport cython
3240
from libc.limits cimport INT_MAX
3341
from libc.math cimport sqrt

0 commit comments

Comments
 (0)
0