From f339fb0ef1dbe74cdf4912dc256ec3648308ec2b Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 6 Dec 2021 15:29:37 +0100 Subject: Modify minimal requirements for python typing. Fix no cgal compilation --- src/python/CMakeLists.txt | 1 + src/python/doc/installation.rst | 93 +++++++++++++++++++++-------------------- src/python/pyproject.toml | 2 +- src/python/setup.py.in | 4 +- 4 files changed, 53 insertions(+), 47 deletions(-) (limited to 'src/python') diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index 4a017251..12534b86 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -175,6 +175,7 @@ if(PYTHONINTERP_FOUND) set(GUDHI_CYTHON_MODULES "${GUDHI_CYTHON_MODULES}'euclidean_strong_witness_complex', ") endif () + add_gudhi_debug_info("Boost version ${Boost_VERSION}") if(CGAL_FOUND) # Add CGAL compilation args if(CGAL_HEADER_ONLY) diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst index 35c344e3..6ed53960 100644 --- a/src/python/doc/installation.rst +++ b/src/python/doc/installation.rst @@ -33,25 +33,19 @@ Compiling These instructions are for people who want to compile gudhi from source, they are unnecessary if you installed a binary package of Gudhi as above. They assume that you have downloaded a `release `_, -with a name like `gudhi.3.2.0.tar.gz`, then run `tar xf gudhi.3.2.0.tar.gz`, which -created a directory `gudhi.3.2.0`, hereinafter referred to as `/path-to-gudhi/`. +with a name like `gudhi.3.X.X.tar.gz`, then run `tar xf gudhi.3.X.X.tar.gz`, which +created a directory `gudhi.3.X.X`, hereinafter referred to as `/path-to-gudhi/`. If you are instead using a git checkout, beware that the paths are a bit different, and in particular the `python/` subdirectory is actually `src/python/` there. The library uses c++14 and requires `Boost `_ :math:`\geq` 1.56.0, `CMake `_ :math:`\geq` 3.5 to generate makefiles, -`NumPy `_ :math:`\geq` 1.15.0, `Cython `_ and -`pybind11 `_ to compile -the GUDHI Python module. -It is a multi-platform library and compiles on Linux, Mac OSX and Visual -Studio 2017 or later. +Python :math:`\geq` 3.5, `NumPy `_ :math:`\geq` 1.15.0, `Cython `_ +:math:`\geq` 0.27 and `pybind11 `_ to compile the GUDHI Python module. +It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2017 or later. -On `Windows `_ , only Python -:math:`\geq` 3.5 are available because of the required Visual Studio version. - -On other systems, if you have several Python/python installed, the version 2.X -will be used by default, but you can force it by adding +If you have several Python/python installed, the version 2.X may be used by default, but you can force it by adding :code:`-DPython_ADDITIONAL_VERSIONS=3` to the cmake command. GUDHI Python module compilation @@ -143,53 +137,62 @@ If :code:`import gudhi` succeeds, please have a look to debug information: .. code-block:: python import gudhi - print(gudhi.__debug_info__) +print(gudhi.__debug_info__) +print("+ Installed modules are: " + gudhi.__available_modules) +print("+ Missing modules are: " + gudhi.__missing_modules) You shall have something like: .. code-block:: none - Python version 2.7.15 - Cython version 0.26.1 - Numpy version 1.14.1 - Eigen3 version 3.1.1 - Installed modules are: off_reader;simplex_tree;rips_complex; - cubical_complex;periodic_cubical_complex;reader_utils;witness_complex; - strong_witness_complex;alpha_complex; - Missing modules are: bottleneck_distance;nerve_gic;subsampling; - tangential_complex;persistence_graphical_tools; - euclidean_witness_complex;euclidean_strong_witness_complex; - CGAL version 4.7.1000 - GMP_LIBRARIES = /usr/lib/x86_64-linux-gnu/libgmp.so - GMPXX_LIBRARIES = /usr/lib/x86_64-linux-gnu/libgmpxx.so - TBB version 9107 found and used + Pybind11 version 2.8.1 + Python version 3.7.12 + Cython version 0.29.25 + Numpy version 1.21.4 + Boost version 1.77.0 + print("+ Installed modules are: " + gudhi.__available_modules) + + Installed modules are: off_reader;simplex_tree;rips_complex;cubical_complex;periodic_cubical_complex; + persistence_graphical_tools;reader_utils;witness_complex;strong_witness_complex; + + Missing modules are: bottleneck;nerve_gic;subsampling;tangential_complex;alpha_complex;euclidean_witness_complex; + euclidean_strong_witness_complex; -Here, you can see that bottleneck_distance, nerve_gic, subsampling and -tangential_complex are missing because of the CGAL version. -persistence_graphical_tools is not available as matplotlib is not -available. +Here, you can see that are requiring CGAL are missing because CGAL is not installed. +:code:`persistence_graphical_tools` is installed, but +`its functions `_ will produce an error as +matplotlib is not available. Unitary tests cannot be run as pytest is missing. A complete configuration would be : .. code-block:: none - Python version 3.6.5 - Cython version 0.28.2 - Pytest version 3.3.2 - Matplotlib version 2.2.2 - Numpy version 1.14.5 - Eigen3 version 3.3.4 - Installed modules are: off_reader;simplex_tree;rips_complex; - cubical_complex;periodic_cubical_complex;persistence_graphical_tools; - reader_utils;witness_complex;strong_witness_complex; - persistence_graphical_tools;bottleneck_distance;nerve_gic;subsampling; - tangential_complex;alpha_complex;euclidean_witness_complex; - euclidean_strong_witness_complex; - CGAL header only version 4.11.0 + Pybind11 version 2.8.1 + Python version 3.9.7 + Cython version 0.29.24 + Pytest version 6.2.5 + Matplotlib version 3.5.0 + Numpy version 1.21.4 + Scipy version 1.7.3 + Scikit-learn version 1.0.1 + POT version 0.8.0 + HNSWlib found + PyKeOps version [pyKeOps]: 1.5 + EagerPy version 0.30.0 + TensorFlow version 2.7.0 + Sphinx version 4.3.0 + Sphinx-paramlinks version 0.5.2 + python_docs_theme found + Eigen3 version 3.4.0 + Boost version 1.74.0 + CGAL version 5.3 GMP_LIBRARIES = /usr/lib/x86_64-linux-gnu/libgmp.so GMPXX_LIBRARIES = /usr/lib/x86_64-linux-gnu/libgmpxx.so - TBB version 9107 found and used + MPFR_LIBRARIES = /usr/lib/x86_64-linux-gnu/libmpfr.so + + Installed modules are: bottleneck;off_reader;simplex_tree;rips_complex;cubical_complex;periodic_cubical_complex; + persistence_graphical_tools;reader_utils;witness_complex;strong_witness_complex;nerve_gic;subsampling; + tangential_complex;alpha_complex;euclidean_witness_complex;euclidean_strong_witness_complex; + + Missing modules are: + Documentation ============= diff --git a/src/python/pyproject.toml b/src/python/pyproject.toml index a9fb4985..55b64466 100644 --- a/src/python/pyproject.toml +++ b/src/python/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "wheel", "numpy>=1.15.0", "cython", "pybind11"] +requires = ["setuptools>=24.2.0", "wheel", "numpy>=1.15.0", "cython>=0.27", "pybind11"] build-backend = "setuptools.build_meta" diff --git a/src/python/setup.py.in b/src/python/setup.py.in index 23746998..2c67c2c5 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -5,6 +5,7 @@ Copyright (C) 2019 Inria Modification(s): + - 2021/12 Vincent Rouvreau: Python 3.5 as minimal version - YYYY/MM Author: Description of the modification """ @@ -43,7 +44,7 @@ for module in cython_modules: include_dirs=include_dirs, runtime_library_dirs=runtime_library_dirs,)) -ext_modules = cythonize(ext_modules, compiler_directives={'language_level': str(sys.version_info[0])}) +ext_modules = cythonize(ext_modules, compiler_directives={'language_level': '3'}) for module in pybind11_modules: my_include_dirs = include_dirs + [pybind11.get_include(False), pybind11.get_include(True)] @@ -86,6 +87,7 @@ setup( long_description_content_type='text/x-rst', long_description=long_description, ext_modules = ext_modules, + python_requires='>=3.5.0', install_requires = ['numpy >= 1.15.0',], package_data={"": ["*.dll"], }, ) -- cgit v1.2.3 From 54f6f178d30f59a35758421e285cfac946927064 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 6 Dec 2021 17:36:03 +0100 Subject: Doc review: rephrase --- .github/next_release.md | 2 +- src/python/doc/installation.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/python') diff --git a/.github/next_release.md b/.github/next_release.md index 0d4673bd..5a1215df 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -10,7 +10,7 @@ Below is a list of changes made since GUDHI 3.4.0: - constructs a piecewise-linear approximation of an m-dimensional smooth manifold embedded in R^d using an ambient triangulation. - [Python installation](link) - - Python >= 3.5 and cython >= 0.27 are now required for Python typing purpose. + - Python >= 3.5 and cython >= 0.27 are now required. - [Module](link) - ... diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst index 6ed53960..e8321fed 100644 --- a/src/python/doc/installation.rst +++ b/src/python/doc/installation.rst @@ -156,7 +156,7 @@ You shall have something like: + Missing modules are: bottleneck;nerve_gic;subsampling;tangential_complex;alpha_complex;euclidean_witness_complex; euclidean_strong_witness_complex; -Here, you can see that are requiring CGAL are missing because CGAL is not installed. +Here, you can see that the modules that need CGAL are missing, because CGAL is not installed. :code:`persistence_graphical_tools` is installed, but `its functions `_ will produce an error as matplotlib is not available. -- cgit v1.2.3 From f221db3627c3f71a76f57c3f7b5308b00f1d4248 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Fri, 21 Jan 2022 11:26:46 +0100 Subject: [skip ci] Code review: restore TBB version for the complete configuration example --- src/python/doc/installation.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'src/python') diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst index e8321fed..8fca94f5 100644 --- a/src/python/doc/installation.rst +++ b/src/python/doc/installation.rst @@ -188,6 +188,7 @@ A complete configuration would be : GMP_LIBRARIES = /usr/lib/x86_64-linux-gnu/libgmp.so GMPXX_LIBRARIES = /usr/lib/x86_64-linux-gnu/libgmpxx.so MPFR_LIBRARIES = /usr/lib/x86_64-linux-gnu/libmpfr.so + TBB version 9107 found and used + Installed modules are: bottleneck;off_reader;simplex_tree;rips_complex;cubical_complex;periodic_cubical_complex; persistence_graphical_tools;reader_utils;witness_complex;strong_witness_complex;nerve_gic;subsampling; tangential_complex;alpha_complex;euclidean_witness_complex;euclidean_strong_witness_complex; -- cgit v1.2.3 From 6b6a2ca097e38ca8d1601e764c8f3a6eecfd19e7 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 24 Jan 2022 10:46:27 +0100 Subject: doc review: remove unwanted line. Use 'import gudhi as gd' --- src/python/doc/installation.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/python') diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst index 8fca94f5..873f7870 100644 --- a/src/python/doc/installation.rst +++ b/src/python/doc/installation.rst @@ -33,8 +33,8 @@ Compiling These instructions are for people who want to compile gudhi from source, they are unnecessary if you installed a binary package of Gudhi as above. They assume that you have downloaded a `release `_, -with a name like `gudhi.3.X.X.tar.gz`, then run `tar xf gudhi.3.X.X.tar.gz`, which -created a directory `gudhi.3.X.X`, hereinafter referred to as `/path-to-gudhi/`. +with a name like `gudhi.3.X.Y.tar.gz`, then run `tar xf gudhi.3.X.Y.tar.gz`, which +created a directory `gudhi.3.X.Y`, hereinafter referred to as `/path-to-gudhi/`. If you are instead using a git checkout, beware that the paths are a bit different, and in particular the `python/` subdirectory is actually `src/python/` there. @@ -136,10 +136,10 @@ If :code:`import gudhi` succeeds, please have a look to debug information: .. code-block:: python - import gudhi -print(gudhi.__debug_info__) -print("+ Installed modules are: " + gudhi.__available_modules) -print("+ Missing modules are: " + gudhi.__missing_modules) + import gudhi as gd + print(gd.__debug_info__) + print("+ Installed modules are: " + gd.__available_modules) + print("+ Missing modules are: " + gd.__missing_modules) You shall have something like: @@ -150,7 +150,6 @@ You shall have something like: Cython version 0.29.25 Numpy version 1.21.4 Boost version 1.77.0 - print("+ Installed modules are: " + gudhi.__available_modules) + Installed modules are: off_reader;simplex_tree;rips_complex;cubical_complex;periodic_cubical_complex; persistence_graphical_tools;reader_utils;witness_complex;strong_witness_complex; + Missing modules are: bottleneck;nerve_gic;subsampling;tangential_complex;alpha_complex;euclidean_witness_complex; @@ -349,8 +348,8 @@ You can still deactivate LaTeX rendering by saying: .. code-block:: python - import gudhi - gudhi.persistence_graphical_tools._gudhi_matplotlib_use_tex=False + import gudhi as gd + gd.persistence_graphical_tools._gudhi_matplotlib_use_tex=False PyKeOps ------- -- cgit v1.2.3