From d0fa3f010ab01bf883476fb17aa0e87762c585d2 Mon Sep 17 00:00:00 2001 From: jeremie du boisberranger Date: Fri, 12 Apr 2019 17:49:37 +0200 Subject: [PATCH] use common language_level cython directive --- sklearn/__check_build/_check_build.pyx | 2 -- sklearn/_build_utils/__init__.py | 4 +++- sklearn/_isotonic.pyx | 2 +- sklearn/cluster/_dbscan_inner.pyx | 2 +- sklearn/cluster/_hierarchical.pyx | 2 -- sklearn/cluster/_k_means.pyx | 2 +- sklearn/cluster/_k_means_elkan.pyx | 1 - sklearn/datasets/_svmlight_format.pyx | 4 ++-- sklearn/decomposition/_online_lda.pyx | 2 +- sklearn/decomposition/cdnmf_fast.pyx | 1 - sklearn/ensemble/_gradient_boosting.pyx | 1 - sklearn/feature_extraction/_hashing.pyx | 2 +- sklearn/linear_model/cd_fast.pyx | 2 +- sklearn/linear_model/sag_fast.pyx.tp | 1 - sklearn/linear_model/sgd_fast.pxd | 2 -- sklearn/linear_model/sgd_fast.pyx | 1 - sklearn/manifold/_barnes_hut_tsne.pyx | 1 - sklearn/manifold/_utils.pyx | 2 +- sklearn/metrics/cluster/expected_mutual_info_fast.pyx | 1 - sklearn/metrics/pairwise_fast.pyx | 1 - sklearn/neighbors/ball_tree.pyx | 1 - sklearn/neighbors/binary_tree.pxi | 1 - sklearn/neighbors/dist_metrics.pxd | 1 - sklearn/neighbors/dist_metrics.pyx | 1 - sklearn/neighbors/kd_tree.pyx | 1 - sklearn/neighbors/quad_tree.pxd | 1 - sklearn/neighbors/quad_tree.pyx | 1 - sklearn/neighbors/typedefs.pxd | 1 - sklearn/neighbors/typedefs.pyx | 2 -- sklearn/preprocessing/_csr_polynomial_expansion.pyx | 1 - sklearn/svm/liblinear.pxd | 2 -- sklearn/svm/liblinear.pyx | 1 - sklearn/svm/libsvm.pxd | 2 -- sklearn/svm/libsvm.pyx | 1 - sklearn/svm/libsvm_sparse.pyx | 2 -- sklearn/tree/_criterion.pxd | 1 - sklearn/tree/_criterion.pyx | 1 - sklearn/tree/_splitter.pxd | 1 - sklearn/tree/_splitter.pyx | 1 - sklearn/tree/_tree.pxd | 2 -- sklearn/tree/_tree.pyx | 1 - sklearn/tree/_utils.pxd | 4 ---- sklearn/tree/_utils.pyx | 1 - sklearn/utils/_cython_blas.pxd | 2 -- sklearn/utils/_logistic_sigmoid.pyx | 1 - sklearn/utils/_random.pxd | 2 -- sklearn/utils/_random.pyx | 2 -- sklearn/utils/arrayfuncs.pyx | 1 - sklearn/utils/fast_dict.pxd | 2 -- sklearn/utils/fast_dict.pyx | 2 -- sklearn/utils/graph_shortest_path.pyx | 2 -- sklearn/utils/lgamma.pxd | 2 -- sklearn/utils/lgamma.pyx | 2 -- sklearn/utils/murmurhash.pxd | 1 - sklearn/utils/murmurhash.pyx | 2 -- sklearn/utils/seq_dataset.pxd.tp | 1 - sklearn/utils/seq_dataset.pyx.tp | 1 - sklearn/utils/sparsefuncs_fast.pyx | 2 +- sklearn/utils/weight_vector.pxd | 1 - sklearn/utils/weight_vector.pyx | 1 - 60 files changed, 13 insertions(+), 81 deletions(-) diff --git a/sklearn/__check_build/_check_build.pyx b/sklearn/__check_build/_check_build.pyx index 435428c04cbed..0409e73f5e96d 100644 --- a/sklearn/__check_build/_check_build.pyx +++ b/sklearn/__check_build/_check_build.pyx @@ -1,4 +1,2 @@ -# cython: language_level=3 - def check_build(): return diff --git a/sklearn/_build_utils/__init__.py b/sklearn/_build_utils/__init__.py index 7d1f83d05950b..9c18044f0e75d 100644 --- a/sklearn/_build_utils/__init__.py +++ b/sklearn/_build_utils/__init__.py @@ -81,4 +81,6 @@ def maybe_cythonize_extensions(top_path, config): exc.args += (message,) raise - config.ext_modules = cythonize(config.ext_modules) + config.ext_modules = cythonize( + config.ext_modules, + compiler_directives={'language_level': 3}) diff --git a/sklearn/_isotonic.pyx b/sklearn/_isotonic.pyx index f17b925ad82ef..c7486097df854 100644 --- a/sklearn/_isotonic.pyx +++ b/sklearn/_isotonic.pyx @@ -4,7 +4,7 @@ # enhancement of searching for the longest decreasing subsequence to # pool at each step. # -# cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True +# cython: boundscheck=False, wraparound=False, cdivision=True import numpy as np cimport numpy as np diff --git a/sklearn/cluster/_dbscan_inner.pyx b/sklearn/cluster/_dbscan_inner.pyx index e52597f6826fe..a348bf59d6717 100644 --- a/sklearn/cluster/_dbscan_inner.pyx +++ b/sklearn/cluster/_dbscan_inner.pyx @@ -2,7 +2,7 @@ # Author: Lars Buitinck # License: 3-clause BSD # -# cython: language_level=3, boundscheck=False, wraparound=False +# cython: boundscheck=False, wraparound=False cimport cython from libcpp.vector cimport vector diff --git a/sklearn/cluster/_hierarchical.pyx b/sklearn/cluster/_hierarchical.pyx index d3651683e0810..0a87b82229819 100644 --- a/sklearn/cluster/_hierarchical.pyx +++ b/sklearn/cluster/_hierarchical.pyx @@ -1,6 +1,4 @@ # Author: Gael Varoquaux -# -# cython: language_level=3 import numpy as np cimport numpy as np diff --git a/sklearn/cluster/_k_means.pyx b/sklearn/cluster/_k_means.pyx index e3c069078867a..f81203d40bb4d 100644 --- a/sklearn/cluster/_k_means.pyx +++ b/sklearn/cluster/_k_means.pyx @@ -8,7 +8,7 @@ # # License: BSD 3 clause # -# cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True +# cython: boundscheck=False, wraparound=False, cdivision=True from libc.math cimport sqrt import numpy as np diff --git a/sklearn/cluster/_k_means_elkan.pyx b/sklearn/cluster/_k_means_elkan.pyx index 5324ff92b8daa..81393176a13c5 100644 --- a/sklearn/cluster/_k_means_elkan.pyx +++ b/sklearn/cluster/_k_means_elkan.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # # Author: Andreas Mueller # diff --git a/sklearn/datasets/_svmlight_format.pyx b/sklearn/datasets/_svmlight_format.pyx index c261e1741a104..9644ecbbd20a5 100644 --- a/sklearn/datasets/_svmlight_format.pyx +++ b/sklearn/datasets/_svmlight_format.pyx @@ -5,7 +5,7 @@ # Olivier Grisel # License: BSD 3 clause # -# cython: language_level=2, boundscheck=False, wraparound=False +# cython: boundscheck=False, wraparound=False import array from cpython cimport array @@ -61,7 +61,7 @@ def _load_svmlight_file(f, dtype, bint multilabel, bint zero_based, for line in f: # skip comments line_cstr = line - hash_ptr = strchr(line_cstr, '#') + hash_ptr = strchr(line_cstr, 35) # ASCII value of '#' is 35 if hash_ptr != NULL: line = line[:hash_ptr - line_cstr] diff --git a/sklearn/decomposition/_online_lda.pyx b/sklearn/decomposition/_online_lda.pyx index 5f7f39beed1f0..1c00af02d2375 100644 --- a/sklearn/decomposition/_online_lda.pyx +++ b/sklearn/decomposition/_online_lda.pyx @@ -1,5 +1,5 @@ # -# cython: language_level=3, boundscheck=False, wraparound=False +# cython: boundscheck=False, wraparound=False cimport cython cimport numpy as np diff --git a/sklearn/decomposition/cdnmf_fast.pyx b/sklearn/decomposition/cdnmf_fast.pyx index cdb8363dfdc62..b5c8341d92619 100644 --- a/sklearn/decomposition/cdnmf_fast.pyx +++ b/sklearn/decomposition/cdnmf_fast.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # Author: Mathieu Blondel, Tom Dupre la Tour # License: BSD 3 clause diff --git a/sklearn/ensemble/_gradient_boosting.pyx b/sklearn/ensemble/_gradient_boosting.pyx index d0c0eeed49592..120de8b3abeb8 100644 --- a/sklearn/ensemble/_gradient_boosting.pyx +++ b/sklearn/ensemble/_gradient_boosting.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # # Author: Peter Prettenhofer # diff --git a/sklearn/feature_extraction/_hashing.pyx b/sklearn/feature_extraction/_hashing.pyx index 039c5392293cd..9fa5828a9e715 100644 --- a/sklearn/feature_extraction/_hashing.pyx +++ b/sklearn/feature_extraction/_hashing.pyx @@ -1,7 +1,7 @@ # Author: Lars Buitinck # License: BSD 3 clause # -# cython: language_level=3, boundscheck=False, cdivision=True +# cython: boundscheck=False, cdivision=True import sys import array diff --git a/sklearn/linear_model/cd_fast.pyx b/sklearn/linear_model/cd_fast.pyx index 1cb04662c96f9..6c58c94eb5d43 100644 --- a/sklearn/linear_model/cd_fast.pyx +++ b/sklearn/linear_model/cd_fast.pyx @@ -6,7 +6,7 @@ # # License: BSD 3 clause # -# cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True +# cython: boundscheck=False, wraparound=False, cdivision=True from libc.math cimport fabs cimport numpy as np diff --git a/sklearn/linear_model/sag_fast.pyx.tp b/sklearn/linear_model/sag_fast.pyx.tp index 21f6469cf7ca0..611b878d3d511 100644 --- a/sklearn/linear_model/sag_fast.pyx.tp +++ b/sklearn/linear_model/sag_fast.pyx.tp @@ -34,7 +34,6 @@ def get_dispatch(dtypes): # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # # Authors: Danny Sullivan # Tom Dupre la Tour diff --git a/sklearn/linear_model/sgd_fast.pxd b/sklearn/linear_model/sgd_fast.pxd index 4bd4ad7710f44..53062097156b7 100644 --- a/sklearn/linear_model/sgd_fast.pxd +++ b/sklearn/linear_model/sgd_fast.pxd @@ -1,6 +1,4 @@ # License: BSD 3 clause -# -# cython: language_level=3 """Helper to load LossFunction from sgd_fast.pyx to sag_fast.pyx""" cdef class LossFunction: diff --git a/sklearn/linear_model/sgd_fast.pyx b/sklearn/linear_model/sgd_fast.pyx index ddea4b9710501..f5f3173a36d67 100644 --- a/sklearn/linear_model/sgd_fast.pyx +++ b/sklearn/linear_model/sgd_fast.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # # Author: Peter Prettenhofer # Mathieu Blondel (partial_fit support) diff --git a/sklearn/manifold/_barnes_hut_tsne.pyx b/sklearn/manifold/_barnes_hut_tsne.pyx index fabbe00b543ca..a9885b1d3ed59 100644 --- a/sklearn/manifold/_barnes_hut_tsne.pyx +++ b/sklearn/manifold/_barnes_hut_tsne.pyx @@ -1,7 +1,6 @@ # cython: boundscheck=False # cython: wraparound=False # cython: cdivision=True -# cython: language_level=3 # # Author: Christopher Moody # Author: Nick Travers diff --git a/sklearn/manifold/_utils.pyx b/sklearn/manifold/_utils.pyx index e50d299313a01..b3ee42eaef8a3 100644 --- a/sklearn/manifold/_utils.pyx +++ b/sklearn/manifold/_utils.pyx @@ -1,4 +1,4 @@ -# cython: language_level=3, boundscheck=False +# cython: boundscheck=False from libc cimport math cimport cython diff --git a/sklearn/metrics/cluster/expected_mutual_info_fast.pyx b/sklearn/metrics/cluster/expected_mutual_info_fast.pyx index 82d7bf4126aff..a314abb10620d 100644 --- a/sklearn/metrics/cluster/expected_mutual_info_fast.pyx +++ b/sklearn/metrics/cluster/expected_mutual_info_fast.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # # Authors: Robert Layton # Corey Lynch diff --git a/sklearn/metrics/pairwise_fast.pyx b/sklearn/metrics/pairwise_fast.pyx index 1a77aad2e6aa1..bf56cfee844f0 100644 --- a/sklearn/metrics/pairwise_fast.pyx +++ b/sklearn/metrics/pairwise_fast.pyx @@ -1,7 +1,6 @@ #cython: boundscheck=False #cython: cdivision=True #cython: wraparound=False -# cython: language_level=3 # # Author: Andreas Mueller # Lars Buitinck diff --git a/sklearn/neighbors/ball_tree.pyx b/sklearn/neighbors/ball_tree.pyx index 95cedb2822f5b..bb91abd9cb8ad 100644 --- a/sklearn/neighbors/ball_tree.pyx +++ b/sklearn/neighbors/ball_tree.pyx @@ -2,7 +2,6 @@ #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True -# cython: language_level=3 # Author: Jake Vanderplas # License: BSD 3 clause diff --git a/sklearn/neighbors/binary_tree.pxi b/sklearn/neighbors/binary_tree.pxi index 9f3a94e3ef20f..9b18b1538dcd4 100755 --- a/sklearn/neighbors/binary_tree.pxi +++ b/sklearn/neighbors/binary_tree.pxi @@ -1,5 +1,4 @@ #!python -# cython: language_level=3 # KD Tree and Ball Tree diff --git a/sklearn/neighbors/dist_metrics.pxd b/sklearn/neighbors/dist_metrics.pxd index b903972f3b82f..621efb2987b59 100644 --- a/sklearn/neighbors/dist_metrics.pxd +++ b/sklearn/neighbors/dist_metrics.pxd @@ -2,7 +2,6 @@ #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True -# cython: language_level=3 cimport cython cimport numpy as np diff --git a/sklearn/neighbors/dist_metrics.pyx b/sklearn/neighbors/dist_metrics.pyx index 1e24902c20c9e..cd5966c7b7447 100755 --- a/sklearn/neighbors/dist_metrics.pyx +++ b/sklearn/neighbors/dist_metrics.pyx @@ -2,7 +2,6 @@ #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True -# cython: language_level=3 # By Jake Vanderplas (2013) # written for the scikit-learn project diff --git a/sklearn/neighbors/kd_tree.pyx b/sklearn/neighbors/kd_tree.pyx index 207d83fa4af16..4e713f846a5ec 100644 --- a/sklearn/neighbors/kd_tree.pyx +++ b/sklearn/neighbors/kd_tree.pyx @@ -2,7 +2,6 @@ #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True -# cython: language_level=3 # By Jake Vanderplas (2013) # written for the scikit-learn project diff --git a/sklearn/neighbors/quad_tree.pxd b/sklearn/neighbors/quad_tree.pxd index 89d742b004b86..d5ef080556516 100644 --- a/sklearn/neighbors/quad_tree.pxd +++ b/sklearn/neighbors/quad_tree.pxd @@ -1,7 +1,6 @@ # cython: boundscheck=False # cython: wraparound=False # cython: cdivision=True -# cython: language_level=3 # # Author: Thomas Moreau # Author: Olivier Grisel diff --git a/sklearn/neighbors/quad_tree.pyx b/sklearn/neighbors/quad_tree.pyx index 2934d64ae7933..b70d8f968a3b6 100644 --- a/sklearn/neighbors/quad_tree.pyx +++ b/sklearn/neighbors/quad_tree.pyx @@ -1,7 +1,6 @@ # cython: boundscheck=False # cython: wraparound=False # cython: cdivision=True -# cython: language_level=3 # # Author: Thomas Moreau # Author: Olivier Grisel diff --git a/sklearn/neighbors/typedefs.pxd b/sklearn/neighbors/typedefs.pxd index 3447809845e4e..b121953d15e4e 100644 --- a/sklearn/neighbors/typedefs.pxd +++ b/sklearn/neighbors/typedefs.pxd @@ -1,5 +1,4 @@ #!python -# cython: language_level=3 cimport numpy as np # Floating point/data type diff --git a/sklearn/neighbors/typedefs.pyx b/sklearn/neighbors/typedefs.pyx index 2a97aab875b82..bbdfd00505b43 100644 --- a/sklearn/neighbors/typedefs.pyx +++ b/sklearn/neighbors/typedefs.pyx @@ -1,6 +1,4 @@ #!python -# -# cython: language_level=3 import numpy as np cimport numpy as np diff --git a/sklearn/preprocessing/_csr_polynomial_expansion.pyx b/sklearn/preprocessing/_csr_polynomial_expansion.pyx index 696f1cdf22212..dd36f8321410f 100644 --- a/sklearn/preprocessing/_csr_polynomial_expansion.pyx +++ b/sklearn/preprocessing/_csr_polynomial_expansion.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # Author: Andrew nystrom diff --git a/sklearn/svm/liblinear.pxd b/sklearn/svm/liblinear.pxd index 17860ccad2b9b..d41dcfb0ff0e5 100644 --- a/sklearn/svm/liblinear.pxd +++ b/sklearn/svm/liblinear.pxd @@ -1,5 +1,3 @@ -# cython: language_level=3 - cimport numpy as np diff --git a/sklearn/svm/liblinear.pyx b/sklearn/svm/liblinear.pyx index 7dab74cf95c1f..ff7efa3aa0b70 100644 --- a/sklearn/svm/liblinear.pyx +++ b/sklearn/svm/liblinear.pyx @@ -1,4 +1,3 @@ -# cython: language_level=3 """ Wrapper for liblinear diff --git a/sklearn/svm/libsvm.pxd b/sklearn/svm/libsvm.pxd index 1fce566272abf..2664a335a372f 100644 --- a/sklearn/svm/libsvm.pxd +++ b/sklearn/svm/libsvm.pxd @@ -1,5 +1,3 @@ -# cython: language_level=3 - cimport numpy as np ################################################################################ diff --git a/sklearn/svm/libsvm.pyx b/sklearn/svm/libsvm.pyx index a6f6a9e7f644c..ded79a1f8318c 100644 --- a/sklearn/svm/libsvm.pyx +++ b/sklearn/svm/libsvm.pyx @@ -1,4 +1,3 @@ -# cython: language_level=3 """ Binding for libsvm_skl ---------------------- diff --git a/sklearn/svm/libsvm_sparse.pyx b/sklearn/svm/libsvm_sparse.pyx index 7183b7ae1ea45..f180560f1d1e7 100644 --- a/sklearn/svm/libsvm_sparse.pyx +++ b/sklearn/svm/libsvm_sparse.pyx @@ -1,5 +1,3 @@ -# cython: language_level=3 - import warnings import numpy as np cimport numpy as np diff --git a/sklearn/tree/_criterion.pxd b/sklearn/tree/_criterion.pxd index e4a09cd6b3394..e4a7e15ce16c1 100644 --- a/sklearn/tree/_criterion.pxd +++ b/sklearn/tree/_criterion.pxd @@ -1,4 +1,3 @@ -# cython: language_level=3 # Authors: Gilles Louppe # Peter Prettenhofer # Brian Holt diff --git a/sklearn/tree/_criterion.pyx b/sklearn/tree/_criterion.pyx index e7b64a921a965..e6c3d628baf53 100644 --- a/sklearn/tree/_criterion.pyx +++ b/sklearn/tree/_criterion.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # Authors: Gilles Louppe # Peter Prettenhofer diff --git a/sklearn/tree/_splitter.pxd b/sklearn/tree/_splitter.pxd index af27e76d646a9..fe6e510c98653 100644 --- a/sklearn/tree/_splitter.pxd +++ b/sklearn/tree/_splitter.pxd @@ -1,4 +1,3 @@ -# cython: language_level=3 # Authors: Gilles Louppe # Peter Prettenhofer # Brian Holt diff --git a/sklearn/tree/_splitter.pyx b/sklearn/tree/_splitter.pyx index d3ca99ab4b54b..fab9aabb03e28 100644 --- a/sklearn/tree/_splitter.pyx +++ b/sklearn/tree/_splitter.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # Authors: Gilles Louppe # Peter Prettenhofer diff --git a/sklearn/tree/_tree.pxd b/sklearn/tree/_tree.pxd index e435ebebbfdbf..14b03103deff0 100644 --- a/sklearn/tree/_tree.pxd +++ b/sklearn/tree/_tree.pxd @@ -7,8 +7,6 @@ # Nelson Liu # # License: BSD 3 clause -# -# cython: language_level=3 # See _tree.pyx for details. diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx index 3def172d02f54..edd47845ad197 100644 --- a/sklearn/tree/_tree.pyx +++ b/sklearn/tree/_tree.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # Authors: Gilles Louppe # Peter Prettenhofer diff --git a/sklearn/tree/_utils.pxd b/sklearn/tree/_utils.pxd index ff6202314cc28..a861c233c7dbf 100644 --- a/sklearn/tree/_utils.pxd +++ b/sklearn/tree/_utils.pxd @@ -1,5 +1,3 @@ -# cython: language_level=3 - # Authors: Gilles Louppe # Peter Prettenhofer # Arnaud Joly @@ -7,8 +5,6 @@ # Nelson Liu # # License: BSD 3 clause -# -# cython: language_level=3 # See _utils.pyx for details. diff --git a/sklearn/tree/_utils.pyx b/sklearn/tree/_utils.pyx index c9e4c240066d4..2771821a9f273 100644 --- a/sklearn/tree/_utils.pyx +++ b/sklearn/tree/_utils.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # Authors: Gilles Louppe # Peter Prettenhofer diff --git a/sklearn/utils/_cython_blas.pxd b/sklearn/utils/_cython_blas.pxd index 30b3ea5e4fc07..3667d2889a13f 100644 --- a/sklearn/utils/_cython_blas.pxd +++ b/sklearn/utils/_cython_blas.pxd @@ -1,5 +1,3 @@ -# cython: language_level=3 - from cython cimport floating diff --git a/sklearn/utils/_logistic_sigmoid.pyx b/sklearn/utils/_logistic_sigmoid.pyx index 11e1d41533d44..4ca32193c5ce6 100644 --- a/sklearn/utils/_logistic_sigmoid.pyx +++ b/sklearn/utils/_logistic_sigmoid.pyx @@ -1,7 +1,6 @@ #cython: boundscheck=False #cython: cdivision=True #cython: wraparound=False -#cython: language_level=3 from libc.math cimport log, exp diff --git a/sklearn/utils/_random.pxd b/sklearn/utils/_random.pxd index c057da4296e6f..276ab50518d40 100644 --- a/sklearn/utils/_random.pxd +++ b/sklearn/utils/_random.pxd @@ -1,8 +1,6 @@ # Authors: Arnaud Joly # # License: BSD 3 clause -# -# cython: language_level=3 import numpy as np diff --git a/sklearn/utils/_random.pyx b/sklearn/utils/_random.pyx index af0eef1d58742..1dcf924e3a90b 100644 --- a/sklearn/utils/_random.pyx +++ b/sklearn/utils/_random.pyx @@ -1,7 +1,5 @@ -# cython: language_level=3 # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # # Author: Arnaud Joly # diff --git a/sklearn/utils/arrayfuncs.pyx b/sklearn/utils/arrayfuncs.pyx index 1c6dc1f4d79ff..06da293164441 100644 --- a/sklearn/utils/arrayfuncs.pyx +++ b/sklearn/utils/arrayfuncs.pyx @@ -1,4 +1,3 @@ -# cython: language_level=3 """ Small collection of auxiliary functions that operate on arrays diff --git a/sklearn/utils/fast_dict.pxd b/sklearn/utils/fast_dict.pxd index 9d91d9c7b7efb..9a1bde475ee62 100644 --- a/sklearn/utils/fast_dict.pxd +++ b/sklearn/utils/fast_dict.pxd @@ -1,7 +1,5 @@ # Author: Gael Varoquaux # License: BSD -# -# cython: language_level=3 """ Uses C++ map containers for fast dict-like behavior with keys being integers, and values float. diff --git a/sklearn/utils/fast_dict.pyx b/sklearn/utils/fast_dict.pyx index 5aa7f6a161a96..719cafc3cc8c1 100644 --- a/sklearn/utils/fast_dict.pyx +++ b/sklearn/utils/fast_dict.pyx @@ -4,8 +4,6 @@ integers, and values float. """ # Author: Gael Varoquaux # License: BSD -# -# cython: language_level=3 cimport cython diff --git a/sklearn/utils/graph_shortest_path.pyx b/sklearn/utils/graph_shortest_path.pyx index 6d66b1ac76c39..365fb35bcf7c3 100644 --- a/sklearn/utils/graph_shortest_path.pyx +++ b/sklearn/utils/graph_shortest_path.pyx @@ -1,7 +1,5 @@ # Author: Jake Vanderplas -- # License: BSD 3 clause, (C) 2011 -# -# cython: language_level=3 """ Routines for performing shortest-path graph searches diff --git a/sklearn/utils/lgamma.pxd b/sklearn/utils/lgamma.pxd index 4d26b262b5122..2010af8f4adc3 100644 --- a/sklearn/utils/lgamma.pxd +++ b/sklearn/utils/lgamma.pxd @@ -1,3 +1 @@ -# cython: language_level=3 - cdef double lgamma(double x) diff --git a/sklearn/utils/lgamma.pyx b/sklearn/utils/lgamma.pyx index c229db6053cfe..c0d21a304c7dc 100644 --- a/sklearn/utils/lgamma.pyx +++ b/sklearn/utils/lgamma.pyx @@ -1,5 +1,3 @@ -# cython: language_level=3 - cdef extern from "src/gamma.h": cdef double sklearn_lgamma(double x) diff --git a/sklearn/utils/murmurhash.pxd b/sklearn/utils/murmurhash.pxd index 1bac7137198d5..ed34ef6c9f006 100644 --- a/sklearn/utils/murmurhash.pxd +++ b/sklearn/utils/murmurhash.pxd @@ -1,4 +1,3 @@ -# cython: language_level=3 """Export fast murmurhash C/C++ routines + cython wrappers""" cimport numpy as np diff --git a/sklearn/utils/murmurhash.pyx b/sklearn/utils/murmurhash.pyx index 110f20e93887c..0aff2146510ff 100644 --- a/sklearn/utils/murmurhash.pyx +++ b/sklearn/utils/murmurhash.pyx @@ -13,8 +13,6 @@ and can be found here: # Author: Olivier Grisel # # License: BSD 3 clause -# -# cython: language_level=3 cimport cython diff --git a/sklearn/utils/seq_dataset.pxd.tp b/sklearn/utils/seq_dataset.pxd.tp index 6834e76f38b72..be781c65fb340 100644 --- a/sklearn/utils/seq_dataset.pxd.tp +++ b/sklearn/utils/seq_dataset.pxd.tp @@ -1,4 +1,3 @@ -# cython: language_level=3 {{py: """ diff --git a/sklearn/utils/seq_dataset.pyx.tp b/sklearn/utils/seq_dataset.pyx.tp index 81e77bb672255..c5540352bc050 100644 --- a/sklearn/utils/seq_dataset.pyx.tp +++ b/sklearn/utils/seq_dataset.pyx.tp @@ -1,4 +1,3 @@ -# cython: language_level=3 # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False diff --git a/sklearn/utils/sparsefuncs_fast.pyx b/sklearn/utils/sparsefuncs_fast.pyx index f218e88e7fe38..da55064ae5dc5 100644 --- a/sklearn/utils/sparsefuncs_fast.pyx +++ b/sklearn/utils/sparsefuncs_fast.pyx @@ -7,7 +7,7 @@ # License: BSD 3 clause #!python -# cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True +# cython: boundscheck=False, wraparound=False, cdivision=True from libc.math cimport fabs, sqrt, pow cimport numpy as np diff --git a/sklearn/utils/weight_vector.pxd b/sklearn/utils/weight_vector.pxd index 4ba4374c05e6c..36af4e39e97c1 100644 --- a/sklearn/utils/weight_vector.pxd +++ b/sklearn/utils/weight_vector.pxd @@ -1,4 +1,3 @@ -# cython: language_level=3 """Efficient (dense) parameter vector implementation for linear models. """ cimport numpy as np diff --git a/sklearn/utils/weight_vector.pyx b/sklearn/utils/weight_vector.pyx index 91c5273d210e4..edd6067059609 100644 --- a/sklearn/utils/weight_vector.pyx +++ b/sklearn/utils/weight_vector.pyx @@ -1,7 +1,6 @@ # cython: cdivision=True # cython: boundscheck=False # cython: wraparound=False -# cython: language_level=3 # # Author: Peter Prettenhofer # Lars Buitinck