Skip to content

Commit

Permalink
CMake: Update excluded examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Apr 26, 2024
1 parent e7c0681 commit 567b8e4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
25 changes: 0 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -616,31 +616,6 @@ if (BUILD_PYTHON)
find_python_module (numpydoc 0.9)
find_python_module (sphinx_gallery 0.7)
find_python_module (sphinxcontrib.jquery)
if (NOT Bonmin_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(optimization_bonmin)")
endif ()
if (NOT Ceres_FOUND AND NOT CMinpack_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(calibration_flooding)|(calibration_chaboche)|(calibration_deflection_tube)")
endif ()
if (NOT dlib_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(optimization_dlib)")
endif ()
if (NOT Pagmo_FOUND)
set(SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(optimization_pagmo)")
endif ()
if (NOT PANDAS_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(sample_pandas)")
endif ()
if (NOT HMAT_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(kriging_cantilever_beam_hmat)")
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(gaussian_process_covariance_hmat)")
endif ()
if (NOT HDF5_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(study_save_load)")
endif ()
if (NOT BISON_FOUND OR NOT FLEX_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(import_export_sample_csv)|(estimate_gpd_rain)")
endif ()
endif ()
if (NOT NUMPYDOC_FOUND OR NOT SPHINX_GALLERY_FOUND OR NOT SPHINXCONTRIB.JQUERY_FOUND OR NOT MATPLOTLIB_FOUND OR NOT LIBXML2_FOUND OR NOT NLopt_FOUND)
set (SPHINX_FOUND FALSE)
Expand Down
31 changes: 31 additions & 0 deletions python/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,37 @@ install (FILES ${SWIGFILES} DESTINATION ${OPENTURNS_SWIG_INCLUDE_DIRS})

if (SPHINX_FOUND)

# exclude examples according to available dependencies
if (NOT Bonmin_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(optimization_bonmin)")
endif ()
if (NOT Ceres_FOUND AND NOT CMinpack_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(calibration_flooding)|(calibration_chaboche)|(calibration_deflection_tube)")
endif ()
if (NOT dlib_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(optimization_dlib)")
endif ()
if (NOT Pagmo_FOUND)
set(SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(optimization_pagmo)")
endif ()
if (NOT PANDAS_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(sample_pandas)")
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(estimate_gpd_wooster)|(estimate_gpd_dowjones)")
endif ()
if (NOT HMAT_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(kriging_cantilever_beam_hmat)")
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(gaussian_process_covariance_hmat)")
endif ()
if (NOT HDF5_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(study_save_load)")
endif ()
if (NOT BISON_FOUND OR NOT FLEX_FOUND)
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(import_export_sample_csv)|(estimate_gev_fremantle)")
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(estimate_gev_pirie)|(estimate_gev_racetime)")
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(estimate_gev_venice)|(estimate_gpd_rain)")
set (SPHINX_GALLERY_IGNORE_PATTERN "${SPHINX_GALLERY_IGNORE_PATTERN}|(estimate_dependence_wavesurge)|(estimate_dependence_wind)")
endif ()

# create a build site-package from which sphinx can import
set (OPENTURNS_PYTHON_BUILD_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR}/site-packages)
execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${OPENTURNS_PYTHON_BUILD_MODULE_PATH}/openturns)
Expand Down
4 changes: 1 addition & 3 deletions python/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ if (MATPLOTLIB_FOUND)
if (NOT PANDAS_FOUND)
set_tests_properties (pyinstallcheck_example_plot_sample_pandas PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_gpd_wooster PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_gpd_dowjones PROPERTIES DISABLED TRUE)
endif ()
if (NOT BISON_FOUND OR NOT FLEX_FOUND)
set_tests_properties (pyinstallcheck_example_plot_import_export_sample_csv PROPERTIES DISABLED TRUE)
Expand All @@ -875,11 +876,8 @@ if (MATPLOTLIB_FOUND)
set_tests_properties (pyinstallcheck_example_plot_estimate_gev_racetime PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_gev_venice PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_gpd_rain PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_gpd_dowjones PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_dependence_wavesurge PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_dependence_wind PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_import_export_sample_csv PROPERTIES DISABLED TRUE)
set_tests_properties (pyinstallcheck_example_plot_estimate_gpd_rain PROPERTIES DISABLED TRUE)
endif ()
if (Python_VERSION VERSION_LESS 3.8)
set_tests_properties (pyinstallcheck_example_plot_enumeratefunction PROPERTIES DISABLED TRUE)
Expand Down

0 comments on commit 567b8e4

Please sign in to comment.