summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2021-10-25 10:34:41 +0200
committerHind-M <hind.montassif@gmail.com>2021-10-25 10:34:41 +0200
commit16044d44e2784508594c4dcb5aa6a0dd52d2c11f (patch)
tree1d3ef0983143ee3e7dfefa96a33d0caae9a66901 /src
parent0bf357f6346fab6edf96d580a9195c2acbb79bae (diff)
parent9116cba43919462f981275a5c2da30cd8b29f0ba (diff)
Merge branch 'knn_dtm_overflow' of https://github.com/Hind-M/gudhi-devel into knn_dtm_overflow
Diffstat (limited to 'src')
-rw-r--r--src/Bottleneck_distance/utilities/bottleneckdistance.md4
-rw-r--r--src/common/doc/examples.h164
-rw-r--r--src/common/doc/installation.h40
-rw-r--r--src/python/CMakeLists.txt77
-rw-r--r--src/python/doc/installation.rst2
-rw-r--r--src/python/pyproject.toml3
-rw-r--r--src/python/setup.py.in2
7 files changed, 161 insertions, 131 deletions
diff --git a/src/Bottleneck_distance/utilities/bottleneckdistance.md b/src/Bottleneck_distance/utilities/bottleneckdistance.md
index a81426cf..2f5dedc9 100644
--- a/src/Bottleneck_distance/utilities/bottleneckdistance.md
+++ b/src/Bottleneck_distance/utilities/bottleneckdistance.md
@@ -10,14 +10,14 @@ Leave the lines above as it is required by the web site generator 'Jekyll'
{:/comment}
-## bottleneck_read_file_example ##
+## bottleneck_distance ##
This program computes the Bottleneck distance between two persistence diagram files.
**Usage**
```
- bottleneck_read_file_example <file_1.pers> <file_2.pers> [<tolerance>]
+ bottleneck_distance <file_1.pers> <file_2.pers> [<tolerance>]
```
where
diff --git a/src/common/doc/examples.h b/src/common/doc/examples.h
index b557727b..a2de4335 100644
--- a/src/common/doc/examples.h
+++ b/src/common/doc/examples.h
@@ -1,98 +1,130 @@
-// List of GUDHI examples - Doxygen needs at least a file tag to analyse comments
-// In user_version, `find . -name "*.cpp"` in example and utilities folders
+// List of GUDHI examples and utils - Doxygen needs at least a file tag to analyse comments
+// Generated from scripts/cpp_examples_for_doxygen.py
/*! @file Examples
- * \section Alpha_complex_examples Alpha complex
- * @example Alpha_complex_from_off.cpp
+ * \section Skeleton_blocker_example_section Skeleton_blocker
+ * @example Skeleton_blocker_iteration.cpp
+ * @example Skeleton_blocker_from_simplices.cpp
+ * @example Skeleton_blocker_link.cpp
+ * \section Alpha_complex_example_section Alpha_complex
+ * @example alpha_complex_persistence.cpp
+ * @example alpha_complex_3d_persistence.cpp
* @example Alpha_complex_from_points.cpp
- * \section bottleneck_examples bottleneck
- * @example bottleneck_basic_example.cpp
- * @example alpha_rips_persistence_bottleneck_distance.cpp
- * @example example_nearest_landmark_table.cpp
- * @example example_witness_complex_off.cpp
- * @example example_witness_complex_sphere.cpp
- * @example example_strong_witness_complex_off.cpp
+ * @example Alpha_complex_3d_from_points.cpp
+ * @example Weighted_alpha_complex_3d_from_points.cpp
+ * @example Fast_alpha_complex_from_off.cpp
+ * @example Alpha_complex_from_off.cpp
+ * @example Weighted_alpha_complex_from_points.cpp
+ * \section Simplex_tree_example_section Simplex_tree
+ * @example cech_complex_cgal_mini_sphere_3d.cpp
* @example mini_simplex_tree.cpp
+ * @example example_alpha_shapes_3_simplex_tree_from_off_file.cpp
* @example graph_expansion_with_blocker.cpp
* @example simple_simplex_tree.cpp
* @example simplex_tree_from_cliques_of_graph.cpp
- * @example example_alpha_shapes_3_simplex_tree_from_off_file.cpp
- * @example cech_complex_cgal_mini_sphere_3d.cpp
- * @example plain_homology.cpp
- * @example persistence_from_file.cpp
- * @example rips_persistence_step_by_step.cpp
+ * \section Collapse_example_section Collapse
+ * @example point_cloud_edge_collapse_rips_persistence.cpp
+ * @example distance_matrix_edge_collapse_rips_persistence.cpp
+ * @example edge_collapse_basic_example.cpp
+ * @example edge_collapse_conserve_persistence.cpp
+ * \section Persistent_cohomology_example_section Persistent_cohomology
* @example rips_persistence_via_boundary_matrix.cpp
+ * @example rips_persistence_step_by_step.cpp
+ * @example plain_homology.cpp
* @example custom_persistence_sort.cpp
* @example persistence_from_simple_simplex_tree.cpp
+ * @example persistence_from_file.cpp
* @example rips_multifield_persistence.cpp
- * @example Skeleton_blocker_from_simplices.cpp
- * @example Skeleton_blocker_iteration.cpp
- * @example Skeleton_blocker_link.cpp
- * @example Garland_heckbert.cpp
- * @example Rips_contraction.cpp
- * @example Random_bitmap_cubical_complex.cpp
- * @example example_CGAL_3D_points_off_reader.cpp
- * @example example_vector_double_points_off_reader.cpp
- * @example example_CGAL_points_off_reader.cpp
- * @example example_one_skeleton_rips_from_distance_matrix.cpp
- * @example example_one_skeleton_rips_from_points.cpp
- * @example example_rips_complex_from_csv_distance_matrix_file.cpp
- * @example example_rips_complex_from_off_file.cpp
- * @example persistence_intervals.cpp
- * @example persistence_vectors.cpp
- * @example persistence_heat_maps.cpp
- * @example persistence_landscape_on_grid.cpp
- * @example persistence_landscape.cpp
- * @example example_basic.cpp
- * @example example_with_perturb.cpp
- * @example example_custom_distance.cpp
- * @example example_choose_n_farthest_points.cpp
- * @example example_sparsify_point_set.cpp
- * @example example_pick_n_random_points.cpp
- * @example CoordGIC.cpp
+ * \section Nerve_GIC_example_section Nerve_GIC
+ * @example VoronoiGIC.cpp
* @example Nerve.cpp
* @example FuncGIC.cpp
- * @example VoronoiGIC.cpp
- * @example example_spatial_searching.cpp
- * @example alpha_complex_3d_persistence.cpp
- * @example alpha_complex_persistence.cpp
- * @example Weighted_alpha_complex_3d_from_points.cpp
- * @example bottleneck_distance.cpp
- * @example weak_witness_persistence.cpp
- * @example strong_witness_persistence.cpp
- * @example cubical_complex_persistence.cpp
- * @example periodic_cubical_complex_persistence.cpp
- * @example off_file_from_shape_generator.cpp
- * @example rips_distance_matrix_persistence.cpp
+ * @example CoordGIC.cpp
+ * \section Rips_complex_example_section Rips_complex
* @example rips_persistence.cpp
+ * @example sparse_rips_persistence.cpp
+ * @example rips_correlation_matrix_persistence.cpp
+ * @example rips_distance_matrix_persistence.cpp
+ * @example example_one_skeleton_rips_from_correlation_matrix.cpp
+ * @example example_rips_complex_from_csv_distance_matrix_file.cpp
+ * @example example_sparse_rips.cpp
+ * @example example_one_skeleton_rips_from_distance_matrix.cpp
+ * @example example_rips_complex_from_off_file.cpp
+ * @example example_one_skeleton_rips_from_points.cpp
+ * \section Persistence_representations_example_section Persistence_representations
+ * @example persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
* @example persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
+ * @example persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
* @example persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
* @example persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
- * @example persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
- * @example persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
* @example persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
- * @example persistence_intervals/compute_number_of_dominant_intervals.cpp
- * @example persistence_intervals/plot_persistence_Betti_numbers.cpp
* @example persistence_intervals/plot_persistence_intervals.cpp
* @example persistence_intervals/plot_histogram_of_intervals_lengths.cpp
* @example persistence_intervals/compute_bottleneck_distance.cpp
- * @example persistence_heat_maps/create_pssk.cpp
- * @example persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
+ * @example persistence_intervals/plot_persistence_Betti_numbers.cpp
+ * @example persistence_intervals/compute_number_of_dominant_intervals.cpp
+ * @example persistence_heat_maps/average_persistence_heat_maps.cpp
* @example persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
- * @example persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
- * @example persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
+ * @example persistence_heat_maps/create_pssk.cpp
* @example persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
- * @example persistence_heat_maps/average_persistence_heat_maps.cpp
+ * @example persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
+ * @example persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
* @example persistence_heat_maps/plot_persistence_heat_map.cpp
+ * @example persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
* @example persistence_heat_maps/create_persistence_heat_maps.cpp
- * @example persistence_vectors/plot_persistence_vectors.cpp
- * @example persistence_vectors/compute_distance_of_persistence_vectors.cpp
* @example persistence_vectors/average_persistence_vectors.cpp
+ * @example persistence_vectors/plot_persistence_vectors.cpp
* @example persistence_vectors/create_persistence_vectors.cpp
* @example persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
- * @example persistence_landscapes/average_landscapes.cpp
- * @example persistence_landscapes/compute_scalar_product_of_landscapes.cpp
+ * @example persistence_vectors/compute_distance_of_persistence_vectors.cpp
* @example persistence_landscapes/create_landscapes.cpp
+ * @example persistence_landscapes/average_landscapes.cpp
* @example persistence_landscapes/compute_distance_of_landscapes.cpp
* @example persistence_landscapes/plot_landscapes.cpp
+ * @example persistence_landscapes/compute_scalar_product_of_landscapes.cpp
+ * @example persistence_heat_maps.cpp
+ * @example sliced_wasserstein.cpp
+ * @example persistence_intervals.cpp
+ * @example persistence_vectors.cpp
+ * @example persistence_landscape.cpp
+ * @example persistence_landscape_on_grid.cpp
+ * \section common_example_section common
+ * @example off_file_from_shape_generator.cpp
+ * @example example_CGAL_points_off_reader.cpp
+ * @example example_vector_double_points_off_reader.cpp
+ * @example example_CGAL_3D_points_off_reader.cpp
+ * \section Subsampling_example_section Subsampling
+ * @example example_pick_n_random_points.cpp
+ * @example example_choose_n_farthest_points.cpp
+ * @example example_sparsify_point_set.cpp
+ * @example example_custom_distance.cpp
+ * \section Contraction_example_section Contraction
+ * @example Rips_contraction.cpp
+ * @example Garland_heckbert.cpp
+ * \section Bottleneck_distance_example_section Bottleneck_distance
+ * @example bottleneck_distance.cpp
+ * @example bottleneck_basic_example.cpp
+ * @example alpha_rips_persistence_bottleneck_distance.cpp
+ * \section Tangential_complex_example_section Tangential_complex
+ * @example example_basic.cpp
+ * @example example_with_perturb.cpp
+ * \section Cech_complex_example_section Cech_complex
+ * @example cech_persistence.cpp
+ * @example cech_complex_example_from_points.cpp
+ * @example cech_complex_step_by_step.cpp
+ * \section Spatial_searching_example_section Spatial_searching
+ * @example example_spatial_searching.cpp
+ * \section Bitmap_cubical_complex_example_section Bitmap_cubical_complex
+ * @example periodic_cubical_complex_persistence.cpp
+ * @example cubical_complex_persistence.cpp
+ * @example Random_bitmap_cubical_complex.cpp
+ * \section Toplex_map_example_section Toplex_map
+ * @example simple_toplex_map.cpp
+ * \section Witness_complex_example_section Witness_complex
+ * @example weak_witness_persistence.cpp
+ * @example strong_witness_persistence.cpp
+ * @example example_witness_complex_sphere.cpp
+ * @example example_strong_witness_complex_off.cpp
+ * @example example_nearest_landmark_table.cpp
+ * @example example_witness_complex_off.cpp
*/
diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h
index 5d40a48e..609f2f2f 100644
--- a/src/common/doc/installation.h
+++ b/src/common/doc/installation.h
@@ -88,9 +88,9 @@ make \endverbatim
* Witness_complex/example_witness_complex_off.cpp</a>
* \li <a href="example_witness_complex_sphere_8cpp-example.html">
* Witness_complex/example_witness_complex_sphere.cpp</a>
- * \li <a href="alpha_complex_from_off_8cpp-example.html">
+ * \li <a href="_alpha_complex_from_off_8cpp-example.html">
* Alpha_complex/Alpha_complex_from_off.cpp</a>
- * \li <a href="alpha_complex_from_points_8cpp-example.html">
+ * \li <a href="_alpha_complex_from_points_8cpp-example.html">
* Alpha_complex/Alpha_complex_from_points.cpp</a>
* \li <a href="alpha_complex_persistence_8cpp-example.html">
* Alpha_complex/alpha_complex_persistence.cpp</a>
@@ -100,15 +100,15 @@ make \endverbatim
* Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp.cpp</a>
* \li <a href="bottleneck_basic_example_8cpp-example.html">
* Bottleneck_distance/bottleneck_basic_example.cpp</a>
- * \li <a href="bottleneck_read_file_8cpp-example.html">
+ * \li <a href="bottleneck_distance_8cpp-example.html">
* Bottleneck_distance/bottleneck_distance.cpp</a>
- * \li <a href="coord_g_i_c_8cpp-example.html">
+ * \li <a href="_coord_g_i_c_8cpp-example.html">
* Nerve_GIC/CoordGIC.cpp</a>
- * \li <a href="func_g_i_c_8cpp-example.html">
+ * \li <a href="_func_g_i_c_8cpp-example.html">
* Nerve_GIC/FuncGIC.cpp</a>
- * \li <a href="nerve_8cpp-example.html">
+ * \li <a href="_nerve_8cpp-example.html">
* Nerve_GIC/Nerve.cpp</a>
- * \li <a href="voronoi_g_i_c_8cpp-example.html">
+ * \li <a href="_voronoi_g_i_c_8cpp-example.html">
* Nerve_GIC/VoronoiGIC.cpp</a>
* \li <a href="example_spatial_searching_8cpp-example.html">
* Spatial_searching/example_spatial_searching.cpp</a>
@@ -122,7 +122,7 @@ make \endverbatim
* Tangential_complex/example_basic.cpp</a>
* \li <a href="example_with_perturb_8cpp-example.html">
* Tangential_complex/example_with_perturb.cpp</a>
- * \li <a href="weighted_alpha_complex_3d_from_points_8cpp-example.html">
+ * \li <a href="_weighted_alpha_complex_3d_from_points_8cpp-example.html">
* Alpha_complex/Weighted_alpha_complex_3d_from_points.cpp</a>
* \li <a href="alpha_complex_3d_persistence_8cpp-example.html">
* Alpha_complex/alpha_complex_3d_persistence.cpp</a>
@@ -134,15 +134,15 @@ make \endverbatim
*
* The following examples/utilities require the <a target="_blank" href="http://eigen.tuxfamily.org/">Eigen</a> and will not be
* built if Eigen is not installed:
- * \li <a href="alpha_complex_from_off_8cpp-example.html">
+ * \li <a href="_alpha_complex_from_off_8cpp-example.html">
* Alpha_complex/Alpha_complex_from_off.cpp</a>
- * \li <a href="alpha_complex_from_points_8cpp-example.html">
+ * \li <a href="_alpha_complex_from_points_8cpp-example.html">
* Alpha_complex/Alpha_complex_from_points.cpp</a>
* \li <a href="alpha_complex_persistence_8cpp-example.html">
* Alpha_complex/alpha_complex_persistence.cpp</a>
* \li <a href="alpha_complex_3d_persistence_8cpp-example.html">
* Alpha_complex/alpha_complex_3d_persistence.cpp</a>
- * \li <a href="weighted_alpha_complex_3d_from_points_8cpp-example.html">
+ * \li <a href="_weighted_alpha_complex_3d_from_points_8cpp-example.html">
* Alpha_complex/Weighted_alpha_complex_3d_from_points.cpp</a>
* \li <a href="alpha_rips_persistence_bottleneck_distance_8cpp-example.html">
* Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp.cpp</a>
@@ -179,27 +179,27 @@ make \endverbatim
* Having Intel&reg; TBB installed is recommended to parallelize and accelerate some GUDHI computations.
*
* The following examples/utilities are using Intel&reg; TBB if installed:
- * \li <a href="alpha_complex_from_off_8cpp-example.html">
+ * \li <a href="_alpha_complex_from_off_8cpp-example.html">
* Alpha_complex/Alpha_complex_from_off.cpp</a>
- * \li <a href="alpha_complex_from_points_8cpp-example.html">
+ * \li <a href="_alpha_complex_from_points_8cpp-example.html">
* Alpha_complex/Alpha_complex_from_points.cpp</a>
* \li <a href="alpha_complex_3d_persistence_8cpp-example.html">
* Alpha_complex/alpha_complex_3d_persistence.cpp</a>
* \li <a href="alpha_complex_persistence_8cpp-example.html">
* Alpha_complex/alpha_complex_persistence.cpp</a>
- * \li <a href="bitmap_cubical_complex_8cpp-example.html">
+ * \li <a href="cubical_complex_persistence_8cpp-example.html">
* Bitmap_cubical_complex/cubical_complex_persistence.cpp</a>
- * \li <a href="bitmap_cubical_complex_periodic_boundary_conditions_8cpp-example.html">
+ * \li <a href="periodic_cubical_complex_persistence_8cpp-example.html">
* Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp</a>
- * \li <a href="random_bitmap_cubical_complex_8cpp-example.html">
+ * \li <a href="_random_bitmap_cubical_complex_8cpp-example.html">
* Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp</a>
- * \li <a href="coord_g_i_c_8cpp-example.html">
+ * \li <a href="_coord_g_i_c_8cpp-example.html">
* Nerve_GIC/CoordGIC.cpp</a>
- * \li <a href="func_g_i_c_8cpp-example.html">
+ * \li <a href="_func_g_i_c_8cpp-example.html">
* Nerve_GIC/FuncGIC.cpp</a>
- * \li <a href="nerve_8cpp-example.html">
+ * \li <a href="_nerve_8cpp-example.html">
* Nerve_GIC/Nerve.cpp</a>
- * \li <a href="voronoi_g_i_c_8cpp-example.html">
+ * \li <a href="_voronoi_g_i_c_8cpp-example.html">
* Nerve_GIC/VoronoiGIC.cpp</a>
* \li <a href="simple_simplex_tree_8cpp-example.html">
* Simplex_tree/simple_simplex_tree.cpp</a>
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index f534fc2a..96107cfe 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -41,14 +41,15 @@ function( add_gudhi_debug_info DEBUG_INFO )
endfunction( add_gudhi_debug_info )
if(PYTHONINTERP_FOUND)
- if(PYBIND11_FOUND)
+ if(PYBIND11_FOUND AND CYTHON_FOUND)
add_gudhi_debug_info("Pybind11 version ${PYBIND11_VERSION}")
+ # PyBind11 modules
set(GUDHI_PYTHON_MODULES "${GUDHI_PYTHON_MODULES}'bottleneck', ")
set(GUDHI_PYTHON_MODULES_EXTRA "${GUDHI_PYTHON_MODULES_EXTRA}'hera', ")
set(GUDHI_PYTHON_MODULES_EXTRA "${GUDHI_PYTHON_MODULES_EXTRA}'clustering', ")
set(GUDHI_PYTHON_MODULES_EXTRA "${GUDHI_PYTHON_MODULES_EXTRA}'datasets', ")
- endif()
- if(CYTHON_FOUND)
+
+ # Cython modules
set(GUDHI_PYTHON_MODULES "${GUDHI_PYTHON_MODULES}'off_reader', ")
set(GUDHI_PYTHON_MODULES "${GUDHI_PYTHON_MODULES}'simplex_tree', ")
set(GUDHI_PYTHON_MODULES "${GUDHI_PYTHON_MODULES}'rips_complex', ")
@@ -278,6 +279,7 @@ if(PYTHONINTERP_FOUND)
# Some files for pip package
file(COPY "introduction.rst" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/")
+ file(COPY "pyproject.toml" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/")
add_custom_command(
OUTPUT gudhi.so
@@ -298,35 +300,30 @@ if(PYTHONINTERP_FOUND)
if(SCIPY_FOUND)
if(SKLEARN_FOUND)
if(OT_FOUND)
- if(PYBIND11_FOUND)
- if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- set (GUDHI_SPHINX_MESSAGE "Generating API documentation with Sphinx in ${CMAKE_CURRENT_BINARY_DIR}/sphinx/")
- # User warning - Sphinx is a static pages generator, and configured to work fine with user_version
- # Images and biblio warnings because not found on developper version
- if (GUDHI_PYTHON_PATH STREQUAL "src/python")
- set (GUDHI_SPHINX_MESSAGE "${GUDHI_SPHINX_MESSAGE} \n WARNING : Sphinx is configured for user version, you run it on developper version. Images and biblio will miss")
- endif()
- # sphinx target requires gudhi.so, because conf.py reads gudhi version from it
- add_custom_target(sphinx
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
- COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
- ${SPHINX_PATH} -b html ${CMAKE_CURRENT_SOURCE_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/sphinx
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/gudhi.so"
- COMMENT "${GUDHI_SPHINX_MESSAGE}" VERBATIM)
- add_test(NAME sphinx_py_test
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
- ${SPHINX_PATH} -b doctest ${CMAKE_CURRENT_SOURCE_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/doctest)
- # Set missing or not modules
- set(GUDHI_MODULES ${GUDHI_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MODULES")
- else(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- message("++ Python documentation module will not be compiled because it requires a Eigen3 and CGAL version >= 4.11.0")
- set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MISSING_MODULES")
- endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- else(PYBIND11_FOUND)
- message("++ Python documentation module will not be compiled because pybind11 was not found")
+ if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
+ set (GUDHI_SPHINX_MESSAGE "Generating API documentation with Sphinx in ${CMAKE_CURRENT_BINARY_DIR}/sphinx/")
+ # User warning - Sphinx is a static pages generator, and configured to work fine with user_version
+ # Images and biblio warnings because not found on developper version
+ if (GUDHI_PYTHON_PATH STREQUAL "src/python")
+ set (GUDHI_SPHINX_MESSAGE "${GUDHI_SPHINX_MESSAGE} \n WARNING : Sphinx is configured for user version, you run it on developper version. Images and biblio will miss")
+ endif()
+ # sphinx target requires gudhi.so, because conf.py reads gudhi version from it
+ add_custom_target(sphinx
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
+ COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
+ ${SPHINX_PATH} -b html ${CMAKE_CURRENT_SOURCE_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/sphinx
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/gudhi.so"
+ COMMENT "${GUDHI_SPHINX_MESSAGE}" VERBATIM)
+ add_test(NAME sphinx_py_test
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
+ ${SPHINX_PATH} -b doctest ${CMAKE_CURRENT_SOURCE_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/doctest)
+ # Set missing or not modules
+ set(GUDHI_MODULES ${GUDHI_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MODULES")
+ else(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
+ message("++ Python documentation module will not be compiled because it requires a Eigen3 and CGAL version >= 4.11.0")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MISSING_MODULES")
- endif(PYBIND11_FOUND)
+ endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
else(OT_FOUND)
message("++ Python documentation module will not be compiled because POT was not found")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MISSING_MODULES")
@@ -402,9 +399,7 @@ if(PYTHONINTERP_FOUND)
COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/bottleneck_basic_example.py")
- if (PYBIND11_FOUND)
- add_gudhi_py_test(test_bottleneck_distance)
- endif()
+ add_gudhi_py_test(test_bottleneck_distance)
# Cover complex
file(COPY ${CMAKE_SOURCE_DIR}/data/points/human.off DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
@@ -518,14 +513,14 @@ if(PYTHONINTERP_FOUND)
add_gudhi_py_test(test_reader_utils)
# Wasserstein
- if(OT_FOUND AND PYBIND11_FOUND)
+ if(OT_FOUND)
# EagerPy dependency because of enable_autodiff=True
if(EAGERPY_FOUND)
add_gudhi_py_test(test_wasserstein_distance)
endif()
+
add_gudhi_py_test(test_wasserstein_barycenter)
- endif()
- if(OT_FOUND)
+
if(TORCH_FOUND AND TENSORFLOW_FOUND AND EAGERPY_FOUND)
add_gudhi_py_test(test_wasserstein_with_tensors)
endif()
@@ -546,7 +541,7 @@ if(PYTHONINTERP_FOUND)
endif()
# Tomato
- if(SCIPY_FOUND AND SKLEARN_FOUND AND PYBIND11_FOUND)
+ if(SCIPY_FOUND AND SKLEARN_FOUND)
add_gudhi_py_test(test_tomato)
endif()
@@ -563,10 +558,10 @@ if(PYTHONINTERP_FOUND)
# Set missing or not modules
set(GUDHI_MODULES ${GUDHI_MODULES} "python" CACHE INTERNAL "GUDHI_MODULES")
- else(CYTHON_FOUND)
- message("++ Python module will not be compiled because cython was not found")
+ else(PYBIND11_FOUND AND CYTHON_FOUND)
+ message("++ Python module will not be compiled because cython and/or pybind11 was/were not found")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python" CACHE INTERNAL "GUDHI_MISSING_MODULES")
- endif(CYTHON_FOUND)
+ endif(PYBIND11_FOUND AND CYTHON_FOUND)
else(PYTHONINTERP_FOUND)
message("++ Python module will not be compiled because no Python interpreter was found")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python" CACHE INTERNAL "GUDHI_MISSING_MODULES")
diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst
index cb7700ce..35c344e3 100644
--- a/src/python/doc/installation.rst
+++ b/src/python/doc/installation.rst
@@ -359,7 +359,7 @@ Python Optimal Transport
------------------------
The :doc:`Wasserstein distance </wasserstein_distance_user>`
-module requires `POT <https://pot.readthedocs.io/>`_, a library that provides
+module requires `POT <https://pythonot.github.io/>`_, a library that provides
several solvers for optimization problems related to Optimal Transport.
PyTorch
diff --git a/src/python/pyproject.toml b/src/python/pyproject.toml
new file mode 100644
index 00000000..a9fb4985
--- /dev/null
+++ b/src/python/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools", "wheel", "numpy>=1.15.0", "cython", "pybind11"]
+build-backend = "setuptools.build_meta"
diff --git a/src/python/setup.py.in b/src/python/setup.py.in
index c400b601..23746998 100644
--- a/src/python/setup.py.in
+++ b/src/python/setup.py.in
@@ -82,10 +82,10 @@ setup(
},
description='The Gudhi library is an open source library for ' \
'Computational Topology and Topological Data Analysis (TDA).',
+ data_files=[('.', ['./introduction.rst'])],
long_description_content_type='text/x-rst',
long_description=long_description,
ext_modules = ext_modules,
install_requires = ['numpy >= 1.15.0',],
- setup_requires = ['cython','numpy >= 1.15.0','pybind11',],
package_data={"": ["*.dll"], },
)