Skip to content

Commit

Permalink
MAINT Remove NPY deprecated api warnings during meson build (#318)
Browse files Browse the repository at this point in the history
* Fix meson compile warnings to NPY_1_9

---------

Signed-off-by: Adam Li <adam2392@gmail.com>
  • Loading branch information
adam2392 committed Aug 20, 2024
1 parent 4062dfd commit 244c706
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion treeple/_lib/sklearn_fork
Submodule sklearn_fork updated 47 files
+58 −0 .github/workflows/update-lock-files-pr.yml
+1 −1 build_tools/azure/debian_atlas_32bit_lock.txt
+28 −28 build_tools/azure/pylatest_conda_forge_mkl_linux-64_conda.lock
+9 −9 build_tools/azure/pylatest_conda_forge_mkl_osx-64_conda.lock
+4 −4 build_tools/azure/pylatest_conda_mkl_no_openmp_osx-64_conda.lock
+6 −6 build_tools/azure/pylatest_pip_openblas_pandas_linux-64_conda.lock
+3 −3 build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock
+6 −6 build_tools/azure/pymin_conda_forge_mkl_win-64_conda.lock
+8 −8 build_tools/azure/pymin_conda_forge_openblas_min_dependencies_linux-64_conda.lock
+10 −10 build_tools/azure/pymin_conda_forge_openblas_ubuntu_2204_linux-64_conda.lock
+18 −18 build_tools/circle/doc_linux-64_conda.lock
+13 −13 build_tools/circle/doc_min_dependencies_linux-64_conda.lock
+9 −9 build_tools/cirrus/pymin_conda_forge_linux-aarch64_conda.lock
+29 −29 build_tools/github/pylatest_conda_forge_cuda_array-api_linux-64_conda.lock
+73 −0 build_tools/on_pr_comment_update_environments_and_lock_files.py
+30 −1 doc/about.rst
+39 −4 doc/developers/contributing.rst
+ doc/images/czi-small.png
+ doc/images/czi.png
+0 −19 doc/images/czi_logo.svg
+ doc/images/wellcome-trust-small.png
+ doc/images/wellcome-trust.png
+2 −2 doc/metadata_routing.rst
+5 −0 doc/modules/grid_search.rst
+2 −1 doc/modules/svm.rst
+2 −0 doc/templates/index.html
+7 −0 doc/whats_new/v1.5.rst
+4 −0 doc/whats_new/v1.6.rst
+6 −6 examples/applications/plot_species_distribution_modeling.py
+0 −1 meson.build
+8 −1 sklearn/calibration.py
+221 −29 sklearn/feature_selection/_rfe.py
+4 −1 sklearn/feature_selection/_sequential.py
+36 −2 sklearn/feature_selection/tests/test_rfe.py
+1 −1 sklearn/feature_selection/tests/test_sequential.py
+11 −1 sklearn/metrics/_scorer.py
+4 −3 sklearn/model_selection/_search.py
+1 −0 sklearn/model_selection/tests/test_search.py
+2 −0 sklearn/tests/metadata_routing_common.py
+39 −23 sklearn/tests/test_calibration.py
+7 −1 sklearn/tests/test_metaestimators.py
+20 −2 sklearn/tests/test_metaestimators_metadata_routing.py
+10 −1 sklearn/tree/_tree.pxd
+40 −1 sklearn/tree/_tree.pyx
+0 −1 sklearn/tree/_utils.pxd
+50 −0 sklearn/tree/tests/test_tree.py
+1 −1 sklearn/utils/estimator_checks.py
9 changes: 5 additions & 4 deletions treeple/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ print(incdir)
endif

inc_np = include_directories(incdir_numpy)
np_dep = declare_dependency(include_directories: inc_np)
# Don't use the deprecated NumPy C API. Define this to a fixed version instead of
# NPY_API_VERSION in order not to break compilation for released SciPy versions
# when NumPy introduces a new deprecation.
numpy_no_deprecated_api = ['-DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION']
np_dep = declare_dependency(include_directories: inc_np, compile_args: numpy_no_deprecated_api)

cc = meson.get_compiler('c')

Expand All @@ -91,7 +95,6 @@ cc = meson.get_compiler('c')
# py.extension_module('_name',
# 'source_fname',
# numpy_nodepr_api)
numpy_nodepr_api = '-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION'

# XXX: ENABLE WHEN DEBUGGING
boundscheck = 'False'
Expand All @@ -106,8 +109,6 @@ scikit_learn_cython_args = [
]
cython_c_args += scikit_learn_cython_args

c_args += numpy_nodepr_api

python_sources = [
'__init__.py',
'neighbors.py',
Expand Down

0 comments on commit 244c706

Please sign in to comment.