From 59c40d01ba35f7c307607abf612b01a9fe818db7 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Mon, 17 May 2021 09:32:09 +0200 Subject: Announce coxeter in next release --- .github/next_release.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 26143b0e..170c7494 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -6,8 +6,8 @@ We are now using GitHub to develop the GUDHI library, do not hesitate to [fork t Below is a list of changes made since GUDHI 3.4.0: -- [Module](link) - - ... +- [Coxeter triangulation](https://gudhi.inria.fr/doc/latest/group__coxeter__triangulation.html) + - constructs a piecewise-linear approximation of an m-dimensional smooth manifold embedded in R^d using an ambient triangulation. - [Module](link) - ... -- cgit v1.2.3 From 067281bb301e47a60b54051b0f02b976e840718d Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Tue, 29 Jun 2021 11:06:18 +0200 Subject: [skip ci] Modification in accordance with the last Dockerfile_for_pip from gudhi-deploy repo --- .github/workflows/pip-packaging-linux.yml | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-packaging-linux.yml b/.github/workflows/pip-packaging-linux.yml index 0fa2c083..6ce0ba89 100644 --- a/.github/workflows/pip-packaging-linux.yml +++ b/.github/workflows/pip-packaging-linux.yml @@ -14,18 +14,6 @@ jobs: - uses: actions/checkout@v1 with: submodules: true - - name: Build wheel for Python 3.5 - run: | - mkdir build_35 - cd build_35 - cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON35/bin/python .. - cd src/python - $PYTHON35/bin/python setup.py bdist_wheel - auditwheel repair dist/*.whl - - name: Install and test wheel for Python 3.5 - run: | - $PYTHON35/bin/python -m pip install --user pytest build_35/src/python/dist/*.whl - $PYTHON35/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Build wheel for Python 3.6 run: | mkdir build_36 @@ -74,13 +62,25 @@ jobs: run: | $PYTHON39/bin/python -m pip install --user pytest build_39/src/python/dist/*.whl $PYTHON39/bin/python -m pytest src/python/test/test_alpha_complex.py + - name: Build wheel for Python 3.10 + run: | + mkdir build_310 + cd build_310 + cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON310/bin/python .. + cd src/python + $PYTHON310/bin/python setup.py bdist_wheel + auditwheel repair dist/*.whl + - name: Install and test wheel for Python 3.10 + run: | + $PYTHON310/bin/python -m pip install --user pytest build_310/src/python/dist/*.whl + $PYTHON310/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Publish on PyPi env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - $PYTHON39/bin/python -m twine upload build_35/src/python/wheelhouse/* - $PYTHON39/bin/python -m twine upload build_36/src/python/wheelhouse/* - $PYTHON39/bin/python -m twine upload build_37/src/python/wheelhouse/* - $PYTHON39/bin/python -m twine upload build_38/src/python/wheelhouse/* - $PYTHON39/bin/python -m twine upload build_39/src/python/wheelhouse/* + $PYTHON36/bin/python -m twine upload build_36/src/python/wheelhouse/* + $PYTHON36/bin/python -m twine upload build_37/src/python/wheelhouse/* + $PYTHON36/bin/python -m twine upload build_38/src/python/wheelhouse/* + $PYTHON36/bin/python -m twine upload build_39/src/python/wheelhouse/* + $PYTHON36/bin/python -m twine upload build_310/src/python/wheelhouse/* -- cgit v1.2.3 From a91e3bc16d511ef66bb296da6a990a0723100657 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 5 Aug 2021 18:00:40 +0200 Subject: mailing lists migration and rephrase contributions in installation guides --- .github/for_maintainers/new_gudhi_version_creation.md | 4 ++-- src/common/doc/installation.h | 8 +++++--- src/python/doc/installation.rst | 9 +++++---- src/python/setup.py.in | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) (limited to '.github') diff --git a/.github/for_maintainers/new_gudhi_version_creation.md b/.github/for_maintainers/new_gudhi_version_creation.md index d6c4cdd3..3e5295c5 100644 --- a/.github/for_maintainers/new_gudhi_version_creation.md +++ b/.github/for_maintainers/new_gudhi_version_creation.md @@ -128,5 +128,5 @@ docker image on docker hub. ## Mail sending Send version mail to the following lists : -* gudhi-devel@lists.gforge.inria.fr -* gudhi-users@lists.gforge.inria.fr (not for release candidate) +* gudhi-devel@inria.fr +* gudhi-users@inria.fr (not for release candidate) diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h index 610aa17e..5d40a48e 100644 --- a/src/common/doc/installation.h +++ b/src/common/doc/installation.h @@ -243,10 +243,12 @@ make \endverbatim * Witness_complex/example_nearest_landmark_table.cpp * * \section Contributions Bug reports and contributions - * Please help us improving the quality of the GUDHI library. You may report bugs or suggestions to: - * \verbatim Contact: gudhi-users@lists.gforge.inria.fr \endverbatim + * Please help us improving the quality of the GUDHI library. + * You may report bugs or + * contact us for any suggestions. * - * GUDHI is open to external contributions. If you want to join our development team, please contact us. + * GUDHI is open to external contributions. If you want to join our development team, please take some time to read our + * contributing guide. * */ diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst index 9c16b04e..56f27b21 100644 --- a/src/python/doc/installation.rst +++ b/src/python/doc/installation.rst @@ -396,8 +396,9 @@ TensorFlow Bug reports and contributions ***************************** -Please help us improving the quality of the GUDHI library. You may report bugs or suggestions to: +Please help us improving the quality of the GUDHI library. +You may `report bugs `_ or +`contact us `_ for any suggestions. - Contact: gudhi-users@lists.gforge.inria.fr - -GUDHI is open to external contributions. If you want to join our development team, please contact us. +GUDHI is open to external contributions. If you want to join our development team, please take some time to read our +`contributing guide `_. diff --git a/src/python/setup.py.in b/src/python/setup.py.in index 759ec8d8..c400b601 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -71,7 +71,7 @@ setup( name = 'gudhi', packages=find_packages(), # find_namespace_packages(include=["gudhi*"]) author='GUDHI Editorial Board', - author_email='gudhi-contact@lists.gforge.inria.fr', + author_email='gudhi-contact@inria.fr', version='@GUDHI_VERSION@', url='https://gudhi.inria.fr/', project_urls={ -- cgit v1.2.3 From 02bb007b124195931f8aa25dd36834624ace1338 Mon Sep 17 00:00:00 2001 From: VincentRouvreau Date: Mon, 6 Sep 2021 16:01:23 +0200 Subject: update next_release in accordance with this PR --- .github/next_release.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 26143b0e..67455a85 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -6,8 +6,9 @@ We are now using GitHub to develop the GUDHI library, do not hesitate to [fork t Below is a list of changes made since GUDHI 3.4.0: -- [Module](link) - - ... +- [Alpha complex](https://gudhi.inria.fr/python/latest/alpha_complex_user.html) + - the python weighted version for alpha complex is now available in any dimension D. + - `alpha_complex = gudhi.AlphaComplex(off_file='/data/points/tore3D_300.off')` is deprecated, please use [read_points_from_off_file](https://gudhi.inria.fr/python/latest/point_cloud.html#gudhi.read_points_from_off_file) instead. - [Module](link) - ... -- cgit v1.2.3 From 79e6a20ce026ff4c86b1632bb3f1ed16ae5c92a1 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Tue, 2 Nov 2021 17:27:25 +0100 Subject: No more gforge references --- .../for_maintainers/new_gudhi_version_creation.md | 22 ++++---- scripts/create_gudhi_version.sh | 66 ---------------------- src/python/doc/alpha_complex_user.rst | 2 +- 3 files changed, 11 insertions(+), 79 deletions(-) delete mode 100755 scripts/create_gudhi_version.sh (limited to '.github') diff --git a/.github/for_maintainers/new_gudhi_version_creation.md b/.github/for_maintainers/new_gudhi_version_creation.md index 3e5295c5..812758e3 100644 --- a/.github/for_maintainers/new_gudhi_version_creation.md +++ b/.github/for_maintainers/new_gudhi_version_creation.md @@ -68,20 +68,18 @@ make -j 4 all && ctest -j 4 --output-on-failure ## Upload the documentation -Upload by ftp the content of the directory gudhi.doc.@GUDHI_VERSION@/cpp in a new directory on ForgeLogin@scm.gforge.inria.fr:/home/groups/gudhi/htdocs/doc/@GUDHI_VERSION@ +[GUDHI GitHub pages](https://gudhi.github.io/) is only used as a _"qualification"_ web hosting service. +The _"production"_ web hosting service is https://files.inria.fr (cf. [this doc](https://doc-si.inria.fr/display/SU/Espace+web) +or [this one](https://www.nextinpact.com/article/30325/109058-se-connecter-a-serveur-webdav-sous-linux-macos-ou-windows)). -Upload by ftp the content of the directory gudhi.doc.@GUDHI_VERSION@/python in a new directory on ForgeLogin@scm.gforge.inria.fr:/home/groups/gudhi/htdocs/python/@GUDHI_VERSION@ +Upload the content of the directory gudhi.doc.@GUDHI_VERSION@/cpp in a new directory on gudhi WebDAV in doc/@GUDHI_VERSION@ +Delete the directory doc/latest on gudhi WebDAV. +Copy gudhi WebDAV doc/@GUDHI_VERSION@ as doc/latest (no symbolic link with WebDAV). + +Upload the content of the directory gudhi.doc.@GUDHI_VERSION@/python in a new directory on gudhi WebDAV in python/@GUDHI_VERSION@ +Delete the directory python/latest on gudhi WebDAV. +Copy gudhi WebDAV python/@GUDHI_VERSION@ as python/latest (no symbolic link with WebDAV). -Through ssh, make the **latest** link to your new version of the documentation: -```bash -ssh ForgeLogin@scm.gforge.inria.fr -cd /home/groups/gudhi/htdocs/doc -rm latest -ln -s @GUDHI_VERSION@ latest -cd /home/groups/gudhi/htdocs/python -rm latest -ln -s @GUDHI_VERSION@ latest -``` ## Put a version label on files diff --git a/scripts/create_gudhi_version.sh b/scripts/create_gudhi_version.sh deleted file mode 100755 index f2a9233f..00000000 --- a/scripts/create_gudhi_version.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -login="vrouvrea" -version="2.3.0" -cgaldir="/home/vincent/workspace/CGAL-4.11-HO/build" -cpucount=7 - - -# We start from scripts dir in the dev branch -cd .. -RELATIVEURL=`svn info . |grep -F "Relative URL:" | awk '{print $NF}'` - -if [ "$RELATIVEURL" != "^/trunk" ] -then -echo "Script must be launched in trunk and not in $RELATIVEURL" -exit -fi - -rm -rf build; mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=Debug -DDEBUG_TRACES=ON -DCGAL_DIR=${cgaldir} -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_BENCHMARK=ON -DPython_ADDITIONAL_VERSIONS=3 .. -cmake -DCMAKE_BUILD_TYPE=Debug . - -CURRENTDIRECTORY=`pwd` -export PYTHONPATH=$CURRENTDIRECTORY/src/cython:$PYTHONPATH - -make -j ${cpucount} all test - -cd .. -svn st | grep -v GUDHIVersion.cmake | grep "^\?" | awk "{print \$2}" | xargs rm -rf - -svn copy svn+ssh://${login}@scm.gforge.inria.fr/svnroot/gudhi/trunk svn+ssh://${login}@scm.gforge.inria.fr/svnroot/gudhi/tags/gudhi-release-${version} \ - -m "Creating a tag of Gudhi release version ${version}." - -cd build -make user_version - -userversiondir=`find . -type d -name "*_GUDHI_${version}" | sed 's/\.\///g'` -echo "User version directory = ${userversiondir}" - -tar -czvf ${userversiondir}.tar.gz ${userversiondir} - -userdocdir=${userversiondir/GUDHI/GUDHI_DOC} -echo "User documentation directory = ${userdocdir}" -mkdir ${userdocdir} -make doxygen - -cp -R ${userversiondir}/doc/html ${userdocdir}/cpp -cd ${userversiondir} -rm -rf build; mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed -DCGAL_DIR=${cgaldir} -DWITH_GUDHI_EXAMPLE=ON -DPython_ADDITIONAL_VERSIONS=3 .. - -CURRENTDIRECTORY=`pwd` -export PYTHONPATH=$CURRENTDIRECTORY/cython:$PYTHONPATH - -make sphinx - -cp -R cython/sphinx ../../${userdocdir}/python -cd ../.. -tar -czvf ${userdocdir}.tar.gz ${userdocdir} - -cd ${userversiondir}/build -make -j ${cpucount} all test install - -cd ../.. -actualdir=`pwd` -echo "Library is available at ${actualdir}/${userversiondir}.tar.gz" -sha256sum ${userversiondir}.tar.gz -echo "Documentation is available at ${actualdir}/${userdocdir}.tar.gz" diff --git a/src/python/doc/alpha_complex_user.rst b/src/python/doc/alpha_complex_user.rst index fffcb3db..3de94bb8 100644 --- a/src/python/doc/alpha_complex_user.rst +++ b/src/python/doc/alpha_complex_user.rst @@ -163,7 +163,7 @@ As the squared radii computed by CGAL are an approximation, it might happen that :math:`\alpha^2` values do not quite define a proper filtration (i.e. non-decreasing with respect to inclusion). We fix that up by calling :func:`~gudhi.SimplexTree.make_filtration_non_decreasing` (cf. -`C++ version `_). +`C++ version `_). Prune above given filtration value ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- cgit v1.2.3 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 --- .github/next_release.md | 3 + .../modules/GUDHI_third_party_libraries.cmake | 7 +- src/python/CMakeLists.txt | 1 + src/python/doc/installation.rst | 93 +++++++++++----------- src/python/pyproject.toml | 2 +- src/python/setup.py.in | 4 +- 6 files changed, 60 insertions(+), 50 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 170c7494..0d4673bd 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -9,6 +9,9 @@ Below is a list of changes made since GUDHI 3.4.0: - [Coxeter triangulation](https://gudhi.inria.fr/doc/latest/group__coxeter__triangulation.html) - 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. + - [Module](link) - ... diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake index 023061f1..deaea588 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.cmake +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -6,6 +6,10 @@ find_package(Boost 1.56.0 QUIET OPTIONAL_COMPONENTS filesystem unit_test_framewo if(NOT Boost_VERSION) message(FATAL_ERROR "NOTICE: This program requires Boost and will not be compiled.") endif(NOT Boost_VERSION) +INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +message(STATUS "boost include dirs:" ${Boost_INCLUDE_DIRS}) +message(STATUS "boost library dirs:" ${Boost_LIBRARY_DIRS}) + find_package(GMP) if(GMP_FOUND) @@ -89,9 +93,6 @@ add_definitions( -DBOOST_ALL_DYN_LINK ) # problem on Mac with boost_system and boost_thread add_definitions( -DBOOST_SYSTEM_NO_DEPRECATED ) -message(STATUS "boost include dirs:" ${Boost_INCLUDE_DIRS}) -message(STATUS "boost library dirs:" ${Boost_LIBRARY_DIRS}) - # Find the correct Python interpreter. # Can be set with -DPYTHON_EXECUTABLE=/usr/bin/python3 or -DPython_ADDITIONAL_VERSIONS=3 for instance. find_package( PythonInterp ) 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 '.github') 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 66c28bfabb3769dd533dd7baf0b09260726f378e Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Fri, 17 Dec 2021 10:52:49 +0100 Subject: python 3.10 to test build pip. Update vcpkg cgal installation --- .github/workflows/pip-build-linux.yml | 16 ++++++++-------- .github/workflows/pip-build-osx.yml | 2 +- .github/workflows/pip-build-windows.yml | 19 ++++++------------- 3 files changed, 15 insertions(+), 22 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-linux.yml b/.github/workflows/pip-build-linux.yml index 12979a86..44f6dd7c 100644 --- a/.github/workflows/pip-build-linux.yml +++ b/.github/workflows/pip-build-linux.yml @@ -12,15 +12,15 @@ jobs: - uses: actions/checkout@v1 with: submodules: true - - name: Build wheel for Python 3.9 + - name: Build wheel for Python 3.10 run: | - mkdir build_39 - cd build_39 - cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON39/bin/python .. + mkdir build_310 + cd build_310 + cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON310/bin/python .. cd src/python - $PYTHON39/bin/python setup.py bdist_wheel + $PYTHON310/bin/python setup.py bdist_wheel auditwheel repair dist/*.whl - - name: Install and test wheel for Python 3.9 + - name: Install and test wheel for Python 3.10 run: | - $PYTHON39/bin/python -m pip install --user pytest build_39/src/python/dist/*.whl - $PYTHON39/bin/python -m pytest src/python/test/test_alpha_complex.py + $PYTHON310/bin/python -m pip install --user pytest build_310/src/python/dist/*.whl + $PYTHON310/bin/python -m pytest src/python/test/test_alpha_complex.py diff --git a/.github/workflows/pip-build-osx.yml b/.github/workflows/pip-build-osx.yml index 1626bb77..276e0949 100644 --- a/.github/workflows/pip-build-osx.yml +++ b/.github/workflows/pip-build-osx.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.9'] + python-version: ['3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index 0080f4d5..c6560b4a 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.9'] + python-version: ['3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 @@ -20,18 +20,11 @@ jobs: architecture: x64 - name: Install dependencies run: | - cd c:/vcpkg - git fetch --all --tags - git checkout 2020.11-1 - bootstrap-vcpkg.bat set VCPKG_BUILD_TYPE=release - vcpkg install eigen3 mpfr boost-accumulators boost-algorithm boost-bimap boost-callable-traits boost-concept-check boost-container boost-core boost-detail boost-filesystem boost-functional boost-fusion boost-geometry boost-graph boost-heap boost-intrusive boost-iostreams boost-iterator boost-lambda boost-logic boost-math boost-mpl boost-multi-index boost-multiprecision boost-numeric-conversion boost-optional boost-parameter boost-pool boost-preprocessor boost-property-map boost-property-tree boost-ptr-container boost-random boost-range boost-serialization boost-spirit boost-thread boost-tuple boost-type-traits boost-units boost-utility boost-variant --triplet x64-windows + vcpkg install eigen3 cgal --triplet x64-windows vcpkg version ls C:/vcpkg/installed/x64-windows/bin - Invoke-WebRequest https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip -OutFile CGAL-5.2.1.zip - Expand-Archive -Path CGAL-5.2.1.zip -DestinationPath . - cd CGAL-5.2.1 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DGMP_INCLUDE_DIR=c:/vcpkg/installed/x64-windows/include -DGMP_LIBRARIES=c:/vcpkg/installed/x64-windows/bin/mpir.dll . + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows . cd ${{ github.workspace }} python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt python -m pip list @@ -39,10 +32,10 @@ jobs: run: | mkdir build cd build - cmake -DCGAL_DIR=c:/vcpkg/CGAL-5.2.1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DGMP_INCLUDE_DIR=c:/vcpkg/installed/x64-windows/include -DGMP_LIBRARIES=c:/vcpkg/installed/x64-windows/bin/mpir.dll .. + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. cd src/python - cp c:/vcpkg/installed/x64-windows/bin/mpfr.dll gudhi/ - cp c:/vcpkg/installed/x64-windows/bin/mpir.dll gudhi/ + cp c:/vcpkg/installed/x64-windows/bin/mpfr-6.dll gudhi/ + cp c:/vcpkg/installed/x64-windows/bin/gmp.dll gudhi/ python setup.py bdist_wheel ls dist - name: Install and test python wheel -- cgit v1.2.3 From b9a7226a7bac01eb10651851363b87b4d60d84c6 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Fri, 17 Dec 2021 13:00:32 +0100 Subject: try to fix --- .github/workflows/pip-build-windows.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index c6560b4a..2bbc6f49 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -33,16 +33,21 @@ jobs: mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. - cd src/python + echo %CD% + dir + cd src\python cp c:/vcpkg/installed/x64-windows/bin/mpfr-6.dll gudhi/ cp c:/vcpkg/installed/x64-windows/bin/gmp.dll gudhi/ python setup.py bdist_wheel ls dist - name: Install and test python wheel run: | - cd ${{ github.workspace }} - cd build/src/python/dist/ + echo %CD% + dir + cd dist Get-ChildItem *.whl | ForEach-Object{python -m pip install --user $_.Name} - cd ${{ github.workspace }} + cd .. + echo %CD% + dir python -m pip install --user pytest python -m pytest src/python/test/test_alpha_complex.py -- cgit v1.2.3 From 5eb591bee0cae488af7e5b49f94d0f1c02840fd3 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Fri, 17 Dec 2021 13:57:45 +0100 Subject: Make it more powershellable --- .github/workflows/pip-build-windows.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index 2bbc6f49..f1829e70 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -23,31 +23,29 @@ jobs: set VCPKG_BUILD_TYPE=release vcpkg install eigen3 cgal --triplet x64-windows vcpkg version - ls C:/vcpkg/installed/x64-windows/bin - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows . - cd ${{ github.workspace }} - python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt + ls "C:\vcpkg\installed\x64-windows\bin\" + python -m pip install --user -r .\ext\gudhi-deploy\build-requirements.txt python -m pip list - name: Build python wheel run: | mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. - echo %CD% + cd ".\build\" + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. + Get-Location dir - cd src\python - cp c:/vcpkg/installed/x64-windows/bin/mpfr-6.dll gudhi/ - cp c:/vcpkg/installed/x64-windows/bin/gmp.dll gudhi/ + cd ".\src\python\" + cp "C:\vcpkg\installed\x64-windows\bin\mpfr-6.dll" ".\gudhi\" + cp "C:\vcpkg\installed\x64-windows\bin\gmp.dll" ".\gudhi\" python setup.py bdist_wheel ls dist - name: Install and test python wheel run: | - echo %CD% + Get-Location dir - cd dist + cd ".\dist\" Get-ChildItem *.whl | ForEach-Object{python -m pip install --user $_.Name} cd .. - echo %CD% + Get-Location dir python -m pip install --user pytest - python -m pytest src/python/test/test_alpha_complex.py + python -m pytest ".\src\python\test\test_alpha_complex.py" -- cgit v1.2.3 From 921a4de71ce435fc46e9f32fcb75e0e6576dbbfc Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 3 Jan 2022 16:42:20 +0100 Subject: Fix path --- .github/workflows/pip-build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index f1829e70..743497f4 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -30,7 +30,7 @@ jobs: run: | mkdir build cd ".\build\" - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. Get-Location dir cd ".\src\python\" -- cgit v1.2.3 From 4cef95eb986dfaaf70aaae7da630db987639b491 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 3 Jan 2022 22:50:50 +0100 Subject: Install pip package after its build --- .github/workflows/pip-build-windows.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index 743497f4..36917d07 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -26,7 +26,7 @@ jobs: ls "C:\vcpkg\installed\x64-windows\bin\" python -m pip install --user -r .\ext\gudhi-deploy\build-requirements.txt python -m pip list - - name: Build python wheel + - name: Build python wheel and install it run: | mkdir build cd ".\build\" @@ -38,13 +38,10 @@ jobs: cp "C:\vcpkg\installed\x64-windows\bin\gmp.dll" ".\gudhi\" python setup.py bdist_wheel ls dist - - name: Install and test python wheel - run: | - Get-Location - dir cd ".\dist\" Get-ChildItem *.whl | ForEach-Object{python -m pip install --user $_.Name} - cd .. + - name: Test python wheel + run: | Get-Location dir python -m pip install --user pytest -- cgit v1.2.3 From 890f598e784ea8b6cd417c2a949326b4e2028fe5 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Tue, 4 Jan 2022 13:44:26 +0100 Subject: python 3.10 package and test also gudhi version - can be helpful --- .github/workflows/pip-build-linux.yml | 1 + .github/workflows/pip-build-osx.yml | 1 + .github/workflows/pip-build-windows.yml | 1 + .github/workflows/pip-packaging-linux.yml | 5 ++++ .github/workflows/pip-packaging-osx.yml | 3 ++- .github/workflows/pip-packaging-windows.yml | 42 ++++++++++++----------------- 6 files changed, 27 insertions(+), 26 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-linux.yml b/.github/workflows/pip-build-linux.yml index 44f6dd7c..a2b4f085 100644 --- a/.github/workflows/pip-build-linux.yml +++ b/.github/workflows/pip-build-linux.yml @@ -23,4 +23,5 @@ jobs: - name: Install and test wheel for Python 3.10 run: | $PYTHON310/bin/python -m pip install --user pytest build_310/src/python/dist/*.whl + $PYTHON310/bin/python -c "import gudhi; print(gudhi.__version__)" $PYTHON310/bin/python -m pytest src/python/test/test_alpha_complex.py diff --git a/.github/workflows/pip-build-osx.yml b/.github/workflows/pip-build-osx.yml index 276e0949..99d515ff 100644 --- a/.github/workflows/pip-build-osx.yml +++ b/.github/workflows/pip-build-osx.yml @@ -35,4 +35,5 @@ jobs: - name: Install and test python wheel run: | python -m pip install --user pytest build/src/python/dist/*.whl + python -c "import gudhi; print(gudhi.__version__)" python -m pytest src/python/test/test_alpha_complex.py diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index 36917d07..954b59d5 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -45,4 +45,5 @@ jobs: Get-Location dir python -m pip install --user pytest + python -c "import gudhi; print(gudhi.__version__)" python -m pytest ".\src\python\test\test_alpha_complex.py" diff --git a/.github/workflows/pip-packaging-linux.yml b/.github/workflows/pip-packaging-linux.yml index 6ce0ba89..98173ed3 100644 --- a/.github/workflows/pip-packaging-linux.yml +++ b/.github/workflows/pip-packaging-linux.yml @@ -25,6 +25,7 @@ jobs: - name: Install and test wheel for Python 3.6 run: | $PYTHON36/bin/python -m pip install --user pytest build_36/src/python/dist/*.whl + $PYTHON36/bin/python -c "import gudhi; print(gudhi.__version__)" $PYTHON36/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Build wheel for Python 3.7 run: | @@ -37,6 +38,7 @@ jobs: - name: Install and test wheel for Python 3.7 run: | $PYTHON37/bin/python -m pip install --user pytest build_37/src/python/dist/*.whl + $PYTHON37/bin/python -c "import gudhi; print(gudhi.__version__)" $PYTHON37/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Build wheel for Python 3.8 run: | @@ -49,6 +51,7 @@ jobs: - name: Install and test wheel for Python 3.8 run: | $PYTHON38/bin/python -m pip install --user pytest build_38/src/python/dist/*.whl + $PYTHON38/bin/python -c "import gudhi; print(gudhi.__version__)" $PYTHON38/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Build wheel for Python 3.9 run: | @@ -61,6 +64,7 @@ jobs: - name: Install and test wheel for Python 3.9 run: | $PYTHON39/bin/python -m pip install --user pytest build_39/src/python/dist/*.whl + $PYTHON39/bin/python -c "import gudhi; print(gudhi.__version__)" $PYTHON39/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Build wheel for Python 3.10 run: | @@ -73,6 +77,7 @@ jobs: - name: Install and test wheel for Python 3.10 run: | $PYTHON310/bin/python -m pip install --user pytest build_310/src/python/dist/*.whl + $PYTHON310/bin/python -c "import gudhi; print(gudhi.__version__)" $PYTHON310/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Publish on PyPi env: diff --git a/.github/workflows/pip-packaging-osx.yml b/.github/workflows/pip-packaging-osx.yml index 120c15b6..98a77a80 100644 --- a/.github/workflows/pip-packaging-osx.yml +++ b/.github/workflows/pip-packaging-osx.yml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.5', '3.6', '3.7', '3.8', '3.9'] + python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 @@ -37,6 +37,7 @@ jobs: - name: Install and test python wheel run: | python -m pip install --user pytest build/src/python/dist/*.whl + python -c "import gudhi; print(gudhi.__version__)" python -m pytest src/python/test/test_alpha_complex.py - name: Publish on PyPi env: diff --git a/.github/workflows/pip-packaging-windows.yml b/.github/workflows/pip-packaging-windows.yml index f387c5ff..6d1571ef 100644 --- a/.github/workflows/pip-packaging-windows.yml +++ b/.github/workflows/pip-packaging-windows.yml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.5', '3.6', '3.7', '3.8', '3.9'] + python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 @@ -22,40 +22,32 @@ jobs: architecture: x64 - name: Install dependencies run: | - cd c:/vcpkg - git fetch --all --tags - git checkout 2020.11-1 - bootstrap-vcpkg.bat set VCPKG_BUILD_TYPE=release - vcpkg install eigen3 mpfr boost-accumulators boost-algorithm boost-bimap boost-callable-traits boost-concept-check boost-container boost-core boost-detail boost-filesystem boost-functional boost-fusion boost-geometry boost-graph boost-heap boost-intrusive boost-iostreams boost-iterator boost-lambda boost-logic boost-math boost-mpl boost-multi-index boost-multiprecision boost-numeric-conversion boost-optional boost-parameter boost-pool boost-preprocessor boost-property-map boost-property-tree boost-ptr-container boost-random boost-range boost-serialization boost-spirit boost-thread boost-tuple boost-type-traits boost-units boost-utility boost-variant --triplet x64-windows + vcpkg install eigen3 cgal --triplet x64-windows vcpkg version - ls C:/vcpkg/installed/x64-windows/bin - Invoke-WebRequest https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip -OutFile CGAL-5.2.1.zip - Expand-Archive -Path CGAL-5.2.1.zip -DestinationPath . - cd CGAL-5.2.1 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DGMP_INCLUDE_DIR=c:/vcpkg/installed/x64-windows/include -DGMP_LIBRARIES=c:/vcpkg/installed/x64-windows/bin/mpir.dll . - cd ${{ github.workspace }} - python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt + ls "C:\vcpkg\installed\x64-windows\bin\" + python -m pip install --user -r .\ext\gudhi-deploy\build-requirements.txt python -m pip install --user twine python -m pip list - - name: Build python wheel + - name: Build python wheel and install it run: | mkdir build - cd build - cmake -DCGAL_DIR=c:/vcpkg/CGAL-5.2.1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DGMP_INCLUDE_DIR=c:/vcpkg/installed/x64-windows/include -DGMP_LIBRARIES=c:/vcpkg/installed/x64-windows/bin/mpir.dll .. - cd src/python - cp c:/vcpkg/installed/x64-windows/bin/mpfr.dll gudhi/ - cp c:/vcpkg/installed/x64-windows/bin/mpir.dll gudhi/ + cd ".\build\" + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. + Get-Location + dir + cd ".\src\python\" + cp "C:\vcpkg\installed\x64-windows\bin\mpfr-6.dll" ".\gudhi\" + cp "C:\vcpkg\installed\x64-windows\bin\gmp.dll" ".\gudhi\" python setup.py bdist_wheel ls dist - - name: Install and test python wheel - run: | - cd ${{ github.workspace }} - cd build/src/python/dist/ + cd ".\dist\" Get-ChildItem *.whl | ForEach-Object{python -m pip install --user $_.Name} - cd ${{ github.workspace }} + - name: Test python wheel + run: | python -m pip install --user pytest - python -m pytest src/python/test/test_alpha_complex.py + python -c "import gudhi; print(gudhi.__version__)" + python -m pytest ".\src\python\test\test_alpha_complex.py" - name: Publish on PyPi env: TWINE_USERNAME: __token__ -- cgit v1.2.3 From 90721b27e06903ac316cd847530683fc96cd67e1 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Tue, 4 Jan 2022 15:47:36 +0100 Subject: [skip ci] update release note --- .github/next_release.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 170c7494..4845cafb 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -4,16 +4,16 @@ As a major new feature, the GUDHI library now offers ... We are now using GitHub to develop the GUDHI library, do not hesitate to [fork the GUDHI project on GitHub](https://github.com/GUDHI/gudhi-devel). From a user point of view, we recommend to download GUDHI user version (gudhi.3.X.X.tar.gz). -Below is a list of changes made since GUDHI 3.4.0: +Below is a list of changes made since GUDHI 3.4.1: - [Coxeter triangulation](https://gudhi.inria.fr/doc/latest/group__coxeter__triangulation.html) - constructs a piecewise-linear approximation of an m-dimensional smooth manifold embedded in R^d using an ambient triangulation. -- [Module](link) - - ... +- [Datasets generators](https://gudhi.inria.fr/python/latest/datasets_generators.html) + - the python module `points` enables the generation of random points on a sphere, random points on a torus and as a grid. - Miscellaneous - - The [list of bugs that were solved since GUDHI-3.4.0](https://github.com/GUDHI/gudhi-devel/issues?q=label%3A3.5.0+is%3Aclosed) is available on GitHub. + - The [list of bugs that were solved since GUDHI-3.4.1](https://github.com/GUDHI/gudhi-devel/issues?q=label%3A3.5.0+is%3Aclosed) is available on GitHub. All modules are distributed under the terms of the MIT license. However, there are still GPL dependencies for many modules. We invite you to check our [license dedicated web page](https://gudhi.inria.fr/licensing/) for further details. -- cgit v1.2.3 From f4e4229c85adaa14ce9050b317ceedad4e918b34 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Tue, 4 Jan 2022 22:20:13 +0100 Subject: Fix #563 --- .github/workflows/pip-packaging-osx.yml | 2 +- .github/workflows/pip-packaging-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-packaging-osx.yml b/.github/workflows/pip-packaging-osx.yml index 98a77a80..13c4b4e1 100644 --- a/.github/workflows/pip-packaging-osx.yml +++ b/.github/workflows/pip-packaging-osx.yml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/pip-packaging-windows.yml b/.github/workflows/pip-packaging-windows.yml index 6d1571ef..962ae68a 100644 --- a/.github/workflows/pip-packaging-windows.yml +++ b/.github/workflows/pip-packaging-windows.yml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 -- cgit v1.2.3 From fce790683b9cfab5b6bbdc4dc21d79b72e1b61ea Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Tue, 4 Jan 2022 22:22:19 +0100 Subject: Update release note --- .github/next_release.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 4845cafb..cbc7f661 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -1,16 +1,17 @@ We are pleased to announce the release 3.5.0 of the GUDHI library. -As a major new feature, the GUDHI library now offers ... +As a major new feature, the GUDHI library now offers Coxeter triangulations and points generators. +The support for python 3.10 is available. We are now using GitHub to develop the GUDHI library, do not hesitate to [fork the GUDHI project on GitHub](https://github.com/GUDHI/gudhi-devel). From a user point of view, we recommend to download GUDHI user version (gudhi.3.X.X.tar.gz). Below is a list of changes made since GUDHI 3.4.1: -- [Coxeter triangulation](https://gudhi.inria.fr/doc/latest/group__coxeter__triangulation.html) +- [Coxeter triangulation](https://gudhi.inria.fr/doc/3.5.0rc2/group__coxeter__triangulation.html) - constructs a piecewise-linear approximation of an m-dimensional smooth manifold embedded in R^d using an ambient triangulation. -- [Datasets generators](https://gudhi.inria.fr/python/latest/datasets_generators.html) - - the python module `points` enables the generation of random points on a sphere, random points on a torus and as a grid. +- [Datasets generators](https://gudhi.inria.fr/python/3.5.0rc2/datasets_generators.html) + - the python module `points` enables the generation of points on a sphere or a flat torus. - Miscellaneous - The [list of bugs that were solved since GUDHI-3.4.1](https://github.com/GUDHI/gudhi-devel/issues?q=label%3A3.5.0+is%3Aclosed) is available on GitHub. -- cgit v1.2.3 From a76bb1bdd30d1c9571633ec9061aab6ef0f0165b Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Tue, 4 Jan 2022 22:53:25 +0100 Subject: test all config as it fails --- .github/workflows/pip-build-osx.yml | 2 +- .github/workflows/pip-build-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-osx.yml b/.github/workflows/pip-build-osx.yml index 99d515ff..d9129930 100644 --- a/.github/workflows/pip-build-osx.yml +++ b/.github/workflows/pip-build-osx.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.10'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index 954b59d5..0453bf00 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.10'] + python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 -- cgit v1.2.3 From a7383e5010e8c813265e44a59831ab8bc9fd3de5 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Tue, 4 Jan 2022 22:59:16 +0100 Subject: Also remve 3.6 ofr osx as it is not available for x64 --- .github/workflows/pip-build-osx.yml | 2 +- .github/workflows/pip-build-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-osx.yml b/.github/workflows/pip-build-osx.yml index d9129930..040575d5 100644 --- a/.github/workflows/pip-build-osx.yml +++ b/.github/workflows/pip-build-osx.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index 0453bf00..ed304a40 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 -- cgit v1.2.3 From ef9def048874ae864189d97f1813a7e8b8d30bed Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Wed, 5 Jan 2022 07:47:31 +0100 Subject: Rollback build for every python version and package osx for python >= 3.7 --- .github/workflows/pip-build-osx.yml | 2 +- .github/workflows/pip-build-windows.yml | 2 +- .github/workflows/pip-packaging-osx.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to '.github') diff --git a/.github/workflows/pip-build-osx.yml b/.github/workflows/pip-build-osx.yml index 040575d5..99d515ff 100644 --- a/.github/workflows/pip-build-osx.yml +++ b/.github/workflows/pip-build-osx.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index ed304a40..954b59d5 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/pip-packaging-osx.yml b/.github/workflows/pip-packaging-osx.yml index 13c4b4e1..7417300a 100644 --- a/.github/workflows/pip-packaging-osx.yml +++ b/.github/workflows/pip-packaging-osx.yml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 -- cgit v1.2.3 From c4aa381396007780f0f9bc4580c9e7ec5b0c88a0 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Thu, 13 Jan 2022 08:02:55 +0100 Subject: Updates for release 3.5.0. Minor updates in new_gudhi_version_creation.md --- .github/for_maintainers/new_gudhi_version_creation.md | 4 ++-- .github/next_release.md | 4 ++-- CMakeGUDHIVersion.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to '.github') diff --git a/.github/for_maintainers/new_gudhi_version_creation.md b/.github/for_maintainers/new_gudhi_version_creation.md index 812758e3..19ef168e 100644 --- a/.github/for_maintainers/new_gudhi_version_creation.md +++ b/.github/for_maintainers/new_gudhi_version_creation.md @@ -26,7 +26,7 @@ md5sum gudhi.@GUDHI_VERSION@.tar.gz > md5sum.txt sha256sum gudhi.@GUDHI_VERSION@.tar.gz > sha256sum.txt sha512sum gudhi.@GUDHI_VERSION@.tar.gz > sha512sum.txt -make -j 4 all && ctest -j 4 --output-on-failure +make && ctest --output-on-failure ``` ***[Check there are no error]*** @@ -61,7 +61,7 @@ cd ../.. tar -czvf gudhi.doc.@GUDHI_VERSION@.tar.gz gudhi.doc.@GUDHI_VERSION@ cd gudhi.@GUDHI_VERSION@/build -make -j 4 all && ctest -j 4 --output-on-failure +make && ctest --output-on-failure ``` ***[Check there are no error]*** diff --git a/.github/next_release.md b/.github/next_release.md index cbc7f661..50207638 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -7,10 +7,10 @@ We are now using GitHub to develop the GUDHI library, do not hesitate to [fork t Below is a list of changes made since GUDHI 3.4.1: -- [Coxeter triangulation](https://gudhi.inria.fr/doc/3.5.0rc2/group__coxeter__triangulation.html) +- [Coxeter triangulation](https://gudhi.inria.fr/doc/latest/group__coxeter__triangulation.html) - constructs a piecewise-linear approximation of an m-dimensional smooth manifold embedded in R^d using an ambient triangulation. -- [Datasets generators](https://gudhi.inria.fr/python/3.5.0rc2/datasets_generators.html) +- [Datasets generators](https://gudhi.inria.fr/python/latest/datasets_generators.html) - the python module `points` enables the generation of points on a sphere or a flat torus. - Miscellaneous diff --git a/CMakeGUDHIVersion.txt b/CMakeGUDHIVersion.txt index 7d9f20b4..75be0646 100644 --- a/CMakeGUDHIVersion.txt +++ b/CMakeGUDHIVersion.txt @@ -2,7 +2,7 @@ set (GUDHI_MAJOR_VERSION 3) set (GUDHI_MINOR_VERSION 5) # GUDHI_PATCH_VERSION can be 'ZaN' for Alpha release, 'ZbN' for Beta release, 'ZrcN' for release candidate or 'Z' for a final release. -set (GUDHI_PATCH_VERSION 0rc2) +set (GUDHI_PATCH_VERSION 0) set(GUDHI_VERSION ${GUDHI_MAJOR_VERSION}.${GUDHI_MINOR_VERSION}.${GUDHI_PATCH_VERSION}) message(STATUS "GUDHI version : ${GUDHI_VERSION}") -- cgit v1.2.3 From faf80f88bbd7fa2220da0aa14f3394d6af1a4774 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Thu, 13 Jan 2022 15:12:43 +0100 Subject: [skip ci] reset version for the next one --- .github/next_release.md | 18 +++++++++--------- CMakeGUDHIVersion.txt | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 50207638..0a8b2bbb 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -1,20 +1,19 @@ -We are pleased to announce the release 3.5.0 of the GUDHI library. +We are pleased to announce the release 3.X.X of the GUDHI library. -As a major new feature, the GUDHI library now offers Coxeter triangulations and points generators. -The support for python 3.10 is available. +As a major new feature, the GUDHI library now offers ... We are now using GitHub to develop the GUDHI library, do not hesitate to [fork the GUDHI project on GitHub](https://github.com/GUDHI/gudhi-devel). From a user point of view, we recommend to download GUDHI user version (gudhi.3.X.X.tar.gz). -Below is a list of changes made since GUDHI 3.4.1: +Below is a list of changes made since GUDHI 3.5.0: -- [Coxeter triangulation](https://gudhi.inria.fr/doc/latest/group__coxeter__triangulation.html) - - constructs a piecewise-linear approximation of an m-dimensional smooth manifold embedded in R^d using an ambient triangulation. +- [Module](link) + - ... -- [Datasets generators](https://gudhi.inria.fr/python/latest/datasets_generators.html) - - the python module `points` enables the generation of points on a sphere or a flat torus. +- [Module](link) + - ... - Miscellaneous - - The [list of bugs that were solved since GUDHI-3.4.1](https://github.com/GUDHI/gudhi-devel/issues?q=label%3A3.5.0+is%3Aclosed) is available on GitHub. + - The [list of bugs that were solved since GUDHI-3.5.0](https://github.com/GUDHI/gudhi-devel/issues?q=label%3A3.6.0+is%3Aclosed) is available on GitHub. All modules are distributed under the terms of the MIT license. However, there are still GPL dependencies for many modules. We invite you to check our [license dedicated web page](https://gudhi.inria.fr/licensing/) for further details. @@ -26,3 +25,4 @@ We provide [bibtex entries](https://gudhi.inria.fr/doc/latest/_citation.html) fo Feel free to [contact us](https://gudhi.inria.fr/contact/) in case you have any questions or remarks. For further information about downloading and installing the library ([C++](https://gudhi.inria.fr/doc/latest/installation.html) or [Python](https://gudhi.inria.fr/python/latest/installation.html)), please visit the [GUDHI web site](https://gudhi.inria.fr/). + diff --git a/CMakeGUDHIVersion.txt b/CMakeGUDHIVersion.txt index 75be0646..b7f93799 100644 --- a/CMakeGUDHIVersion.txt +++ b/CMakeGUDHIVersion.txt @@ -1,8 +1,8 @@ # Must be conform to pep440 - https://www.python.org/dev/peps/pep-0440/#pre-releases set (GUDHI_MAJOR_VERSION 3) -set (GUDHI_MINOR_VERSION 5) +set (GUDHI_MINOR_VERSION 6) # GUDHI_PATCH_VERSION can be 'ZaN' for Alpha release, 'ZbN' for Beta release, 'ZrcN' for release candidate or 'Z' for a final release. -set (GUDHI_PATCH_VERSION 0) +set (GUDHI_PATCH_VERSION 0a0) set(GUDHI_VERSION ${GUDHI_MAJOR_VERSION}.${GUDHI_MINOR_VERSION}.${GUDHI_PATCH_VERSION}) message(STATUS "GUDHI version : ${GUDHI_VERSION}") -- cgit v1.2.3 From a7ec48c56b16c1197cfad83706e643b07d2d6b56 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:50:47 +0100 Subject: Experiment azure ci instead of appveyor for windows (#574) * Remove appveyor build Windows builds and tests under azure: * Add windows build in azure yaml file and rename pipelines * Remove '-j 4' as not used * Separate c++ and python compilation (tests are easier to be launched under src/python) * Explain the change in tests_strategy --- .appveyor.yml | 80 ------------------------------- .github/for_maintainers/tests_strategy.md | 10 ++-- azure-pipelines.yml | 75 +++++++++++++++++++++++------ 3 files changed, 66 insertions(+), 99 deletions(-) delete mode 100644 .appveyor.yml (limited to '.github') diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 33458a28..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,80 +0,0 @@ -image: - - Visual Studio 2019 - -build: - parallel: true - verbosity: detailed - -configuration: - - Release - -environment: - # update the vcpkg cache even if build fails - # APPVEYOR_SAVE_CACHE_ON_ERROR: true - PYTHON: "C:\\Python39-x64" - PYTHONPATH: "C:\\Python39-x64\\lib\\site-packages" - CMAKE_VCPKG_FLAGS: -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=c:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake - - matrix: - - target: Examples - CMAKE_FLAGS: -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF - - - target: UnitaryTests - CMAKE_FLAGS: -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=ON -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF - - - target: Utilities - CMAKE_FLAGS: -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=ON -DWITH_GUDHI_PYTHON=OFF - - - target: Python - CMAKE_FLAGS: -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON - - -#cache: -# - c:\Tools\vcpkg\installed -# - '%LOCALAPPDATA%\pip\Cache' - -init: - - echo %target% - -install: - - git submodule update --init - - vcpkg update - - vcpkg remove --outdated - - vcpkg upgrade --no-dry-run - - vcpkg install boost-filesystem:x64-windows boost-test:x64-windows boost-program-options:x64-windows tbb:x64-windows eigen3:x64-windows cgal:x64-windows - - dir "C:\Tools\vcpkg\installed\x64-windows\bin\" - - vcpkg integrate install - - CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 - - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - python --version - - pip --version - - python -m pip install --upgrade pip - - python -m pip install --upgrade setuptools - - python -m pip install -r ext\gudhi-deploy\build-requirements.txt - # No PyKeOps on windows, let's workaround this one. - - for /F "tokens=*" %%A in (ext\gudhi-deploy\test-requirements.txt) do python -m pip install %%A - - dir "c:\python39-x64\lib\site-packages" - - dir "%LOCALAPPDATA%\pip\Cache" - - python -c "from scipy import spatial; print(spatial.cKDTree)" - -build_script: - - mkdir build - - cd build - - cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release %CMAKE_FLAGS% %CMAKE_VCPKG_FLAGS% .. - - if [%target%]==[Python] ( - cd src\python & - dir . & - type setup.py & - copy "C:\Tools\vcpkg\installed\x64-windows\bin\mpfr-6.dll" ".\gudhi\" & - copy "C:\Tools\vcpkg\installed\x64-windows\bin\gmp.dll" ".\gudhi\" & - copy "C:\Tools\vcpkg\installed\x64-windows\bin\tbb.dll" ".\gudhi\" & - copy "C:\Tools\vcpkg\installed\x64-windows\bin\tbbmalloc.dll" ".\gudhi\" & - python setup.py build_ext --inplace & - SET PYTHONPATH=%CD%;%PYTHONPATH% & - echo %PYTHONPATH% & - ctest -j 1 --output-on-failure -C Release - ) else ( - dir . & - MSBuild GUDHIdev.sln /m /p:Configuration=Release /p:Platform=x64 & - ctest -j 1 --output-on-failure -C Release -E diff_files - ) diff --git a/.github/for_maintainers/tests_strategy.md b/.github/for_maintainers/tests_strategy.md index 9c181740..c25acf9b 100644 --- a/.github/for_maintainers/tests_strategy.md +++ b/.github/for_maintainers/tests_strategy.md @@ -39,22 +39,24 @@ docker push gudhi/ci_for_gudhi_wo_cgal:latest ### Windows -The compilations has been seperated by categories to be parallelized, but I don't know why builds are not run in parallel: +The compilations are not parallelized, as installation time (about 30 minutes) is too much compare to +build and tests timings (about 30 minutes). Builds and tests include: * examples (C++) * tests (C++) * utils (C++) * python -Doxygen (C++) is not tested. -(cf. `.appveyor.yml`) +Doxygen (C++) is not generated. +(cf. `azure-pipelines.yml`) C++ third parties installation are done thanks to [vcpkg](https://github.com/microsoft/vcpkg/). In case of installation issue, check in [vcpkg issues](https://github.com/microsoft/vcpkg/issues). ### OSx -The compilations has been seperated by categories to be parallelized: +The compilations are not parallelized, but they should, as installation time (about 4 minutes) is +negligeable compare to build and tests timings (about 30 minutes). Builds and tests include: * examples (C++) * tests (C++) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a96323fd..21664244 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,26 +1,26 @@ jobs: - - job: 'Test' - displayName: "Build and test" + - job: 'OSx' + displayName: "Build and test OSx" timeoutInMinutes: 0 cancelTimeoutInMinutes: 60 pool: vmImage: macOS-10.15 variables: - pythonVersion: '3.6' + pythonVersion: '3.7' cmakeBuildType: Release steps: - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add conda to PATH - - - bash: sudo conda create --yes --quiet --name gudhi_build_env - displayName: Create Anaconda environment - + # Use a specific Python version + - task: UsePythonVersion@0 + displayName: Use Python $(pythonVersion) + inputs: + versionSpec: $(pythonVersion) + addToPath: true + architecture: 'x64' + - bash: | - source activate gudhi_build_env git submodule update --init - sudo conda install --yes --quiet --name gudhi_build_env python=$(pythonVersion) python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt python -m pip install --user -r ext/gudhi-deploy/test-requirements.txt python -m pip uninstall -y pykeops @@ -28,11 +28,56 @@ jobs: brew install graphviz doxygen boost eigen gmp mpfr tbb cgal || true displayName: 'Install build dependencies' - bash: | - source activate gudhi_build_env mkdir build cd build - cmake -DCMAKE_BUILD_TYPE:STRING=$(cmakeBuildType) -DWITH_GUDHI_TEST=ON -DWITH_GUDHI_UTILITIES=ON -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 .. - make -j 4 + cmake -DCMAKE_BUILD_TYPE:STRING=$(cmakeBuildType) -DWITH_GUDHI_TEST=ON -DWITH_GUDHI_UTILITIES=ON -DWITH_GUDHI_PYTHON=ON .. + make make doxygen - ctest -j 4 --output-on-failure # -E sphinx remove sphinx build as it fails + ctest --output-on-failure displayName: 'Build, test and documentation generation' + + - job: 'Windows' + displayName: "Build and test Windows" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 60 + pool: + vmImage: windows-latest + variables: + pythonVersion: '3.7' + cmakeVcpkgFlags: -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=c:\vcpkg\scripts\buildsystems\vcpkg.cmake + cmakeFlags: -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_TEST=ON -DWITH_GUDHI_UTILITIES=ON -DWITH_GUDHI_PYTHON=OFF + + steps: + # Use a specific Python version + - task: UsePythonVersion@0 + displayName: Use Python $(pythonVersion) + inputs: + versionSpec: $(pythonVersion) + addToPath: true + architecture: 'x64' + + - script: | + git submodule update --init + python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt + # No PyKeOps on windows, let's workaround this one. + for /F "tokens=*" %%A in (ext\gudhi-deploy\test-requirements.txt) do python -m pip install %%A + vcpkg install boost-filesystem:x64-windows boost-test:x64-windows boost-program-options:x64-windows tbb:x64-windows eigen3:x64-windows cgal:x64-windows + displayName: 'Install build dependencies' + - script: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 + mkdir build + cd build + cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release $(cmakeVcpkgFlags) $(cmakeFlags) .. + MSBuild GUDHIdev.sln /m /p:Configuration=Release /p:Platform=x64 + ctest --output-on-failure -C Release -E diff_files + cmake -DWITH_GUDHI_PYTHON=ON . + cd src\python + copy "C:\vcpkg\installed\x64-windows\bin\mpfr-6.dll" ".\gudhi\" + copy "C:\vcpkg\installed\x64-windows\bin\gmp.dll" ".\gudhi\" + copy "C:\vcpkg\installed\x64-windows\bin\tbb.dll" ".\gudhi\" + copy "C:\vcpkg\installed\x64-windows\bin\tbbmalloc.dll" ".\gudhi\" + python setup.py build_ext --inplace + SET PYTHONPATH=%CD%;%PYTHONPATH% + echo %PYTHONPATH% + ctest --output-on-failure -C Release + displayName: 'Build and test' -- cgit v1.2.3 From 0a61efdf924b228e683af6d7ed1de0e3387292c0 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Fri, 21 Jan 2022 17:56:17 +0100 Subject: [skip ci] Add exact betti curve in release note --- .github/next_release.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 0a8b2bbb..d36c55c6 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -6,8 +6,8 @@ We are now using GitHub to develop the GUDHI library, do not hesitate to [fork t Below is a list of changes made since GUDHI 3.5.0: -- [Module](link) - - ... +- [Representations](https://gudhi.inria.fr/python/latest/representations.html#gudhi.representations.vector_methods.BettiCurve) + - A more flexible Betti curve class capable of computing exact curves - [Module](link) - ... -- cgit v1.2.3 From 4fc331267735a3368160ea7cd001b7fa45d720f7 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Thu, 10 Feb 2022 10:32:18 +0100 Subject: Boost 1.66.0 is now the minimal version as required from cgal 5.1 - Also remove useless include boost/version.h --- .github/next_release.md | 3 +++ src/Alpha_complex/include/gudhi/Alpha_complex_3d.h | 1 - src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h | 1 - src/Subsampling/include/gudhi/sparsify_point_set.h | 5 ----- src/cmake/modules/GUDHI_third_party_libraries.cmake | 2 +- src/common/doc/installation.h | 2 +- src/common/include/gudhi/reader_utils.h | 4 ---- src/python/doc/installation.rst | 2 +- 8 files changed, 6 insertions(+), 14 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 65a92816..e21b25c7 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -13,6 +13,9 @@ Below is a list of changes made since GUDHI 3.5.0: - [Representations](https://gudhi.inria.fr/python/latest/representations.html#gudhi.representations.vector_methods.BettiCurve) - A more flexible Betti curve class capable of computing exact curves +- Installation + - Boost ≥ 1.66.0 is now required (was ≥ 1.56.0). + - [Module](link) - ... diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h index ccc3d852..df5c630e 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h @@ -12,7 +12,6 @@ #ifndef ALPHA_COMPLEX_3D_H_ #define ALPHA_COMPLEX_3D_H_ -#include #include #include #include diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h index ee64a277..e5522cc7 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h @@ -14,7 +14,6 @@ #include #include -#include #include #include diff --git a/src/Subsampling/include/gudhi/sparsify_point_set.h b/src/Subsampling/include/gudhi/sparsify_point_set.h index 4571b8f3..b325fe3c 100644 --- a/src/Subsampling/include/gudhi/sparsify_point_set.h +++ b/src/Subsampling/include/gudhi/sparsify_point_set.h @@ -11,12 +11,7 @@ #ifndef SPARSIFY_POINT_SET_H_ #define SPARSIFY_POINT_SET_H_ -#include -#if BOOST_VERSION < 106600 -# include -#else # include -#endif #include #ifdef GUDHI_SUBSAMPLING_PROFILING diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake index b316740d..68ffaee1 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.cmake +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -1,6 +1,6 @@ # This files manage third party libraries required by GUDHI -find_package(Boost 1.56.0 QUIET OPTIONAL_COMPONENTS filesystem unit_test_framework program_options) +find_package(Boost 1.66.0 QUIET OPTIONAL_COMPONENTS filesystem unit_test_framework program_options) # Boost_FOUND is not reliable if(NOT Boost_VERSION) diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h index ef668dfb..67d026bd 100644 --- a/src/common/doc/installation.h +++ b/src/common/doc/installation.h @@ -5,7 +5,7 @@ * Examples of GUDHI headers inclusion can be found in \ref utilities. * * \section compiling Compiling - * The library uses c++14 and requires Boost ≥ 1.56.0 + * The library uses c++14 and requires Boost ≥ 1.66.0 * and CMake ≥ 3.5. * It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015. * diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h index a1b104e2..29d5423d 100644 --- a/src/common/include/gudhi/reader_utils.h +++ b/src/common/include/gudhi/reader_utils.h @@ -14,11 +14,7 @@ #include #include -#if BOOST_VERSION < 106600 -# include -#else # include -#endif #include #include diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst index 35c344e3..c2c3db34 100644 --- a/src/python/doc/installation.rst +++ b/src/python/doc/installation.rst @@ -39,7 +39,7 @@ 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, +The library uses c++14 and requires `Boost `_ :math:`\geq` 1.66.0, `CMake `_ :math:`\geq` 3.5 to generate makefiles, `NumPy `_ :math:`\geq` 1.15.0, `Cython `_ and `pybind11 `_ to compile -- cgit v1.2.3 From fb8ce008feadcaf6a936740a3ed54d50970c731c Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Fri, 11 Feb 2022 23:11:26 +0100 Subject: __copy__, __deepcopy__, copy, and copy ctors. Still pb with the doc --- .github/next_release.md | 3 ++ src/python/gudhi/simplex_tree.pyx | 54 +++++++++++++++---- src/python/test/test_simplex_tree.py | 102 +++++++++++++++++++++++++++++++---- 3 files changed, 140 insertions(+), 19 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index e21b25c7..3946404b 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -13,6 +13,9 @@ Below is a list of changes made since GUDHI 3.5.0: - [Representations](https://gudhi.inria.fr/python/latest/representations.html#gudhi.representations.vector_methods.BettiCurve) - A more flexible Betti curve class capable of computing exact curves +- [Simplex tree](https://gudhi.inria.fr/python/latest/simplex_tree_ref.html) + - `__copy__`, `__deepcopy__`, `copy` and copy constructors + - Installation - Boost ≥ 1.66.0 is now required (was ≥ 1.56.0). diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx index 6b3116a4..ed7c3b92 100644 --- a/src/python/gudhi/simplex_tree.pyx +++ b/src/python/gudhi/simplex_tree.pyx @@ -30,6 +30,7 @@ cdef class SimplexTree: # unfortunately 'cdef public Simplex_tree_interface_full_featured* thisptr' is not possible # Use intptr_t instead to cast the pointer cdef public intptr_t thisptr + cdef bool __thisptr_to_be_deleted # Get the pointer casted as it should be cdef Simplex_tree_interface_full_featured* get_ptr(self) nogil: @@ -38,17 +39,36 @@ cdef class SimplexTree: cdef Simplex_tree_persistence_interface * pcohptr # Fake constructor that does nothing but documenting the constructor - def __init__(self): + def __init__(self, other = None, copy = True): """SimplexTree constructor. + :param other: If `other` is a SimplexTree (default = None), the SimplexTree is constructed from a deep/shallow copy of `other`. + :type other: SimplexTree + :param copy: If `True`, the copy will be deep and if `False, the copy will be shallow. Default is `True`. + :type copy: bool + :returns: A simplex tree that is a (deep or shallow) copy of itself. + :rtype: SimplexTree + :note: copy constructor requires :func:`compute_persistence` to be launched again as the result is not copied. """ # The real cython constructor - def __cinit__(self): - self.thisptr = (new Simplex_tree_interface_full_featured()) + def __cinit__(self, other = None, copy = True): + cdef SimplexTree ostr + if other and type(other) is SimplexTree: + ostr = other + if copy: + self.thisptr = (new Simplex_tree_interface_full_featured(dereference(ostr.get_ptr()))) + else: + self.thisptr = ostr.thisptr + # Avoid double free - The original is in charge of deletion + self.__thisptr_to_be_deleted = False + else: + self.__thisptr_to_be_deleted = True + self.thisptr = (new Simplex_tree_interface_full_featured()) def __dealloc__(self): cdef Simplex_tree_interface_full_featured* ptr = self.get_ptr() - if ptr != NULL: + # Avoid double free - The original is in charge of deletion + if ptr != NULL and self.__thisptr_to_be_deleted: del ptr if self.pcohptr != NULL: del self.pcohptr @@ -63,20 +83,34 @@ cdef class SimplexTree: """ return self.pcohptr != NULL - def copy(self): + def copy(self, deep=True): """ - :returns: A simplex tree that is a deep copy itself. + :param deep: If `True`, the copy will be deep and if `False`, the copy will be shallow. Default is `True`. + :type deep: bool + :returns: A simplex tree that is a (deep or shallow) copy of itself. :rtype: SimplexTree + :note: copy requires :func:`compute_persistence` to be launched again as the result is not copied. """ stree = SimplexTree() cdef Simplex_tree_interface_full_featured* stree_ptr cdef Simplex_tree_interface_full_featured* self_ptr=self.get_ptr() - with nogil: - stree_ptr = new Simplex_tree_interface_full_featured(dereference(self_ptr)) - - stree.thisptr = (stree_ptr) + if deep: + with nogil: + stree_ptr = new Simplex_tree_interface_full_featured(dereference(self_ptr)) + + stree.thisptr = (stree_ptr) + else: + stree.thisptr = self.thisptr + # Avoid double free - The original is in charge of deletion + stree.__thisptr_to_be_deleted = False return stree + def __copy__(self): + return self.copy(deep=False) + + def __deepcopy__(self): + return self.copy(deep=True) + def filtration(self, simplex): """This function returns the filtration value for a given N-simplex in this simplicial complex, or +infinity if it is not in the complex. diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index dac45288..6db6d8fb 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -448,20 +448,104 @@ def test_persistence_intervals_in_dimension(): # Test empty case assert st.persistence_intervals_in_dimension(3).shape == (0, 2) -def test_simplex_tree_copy(): +def test_simplex_tree_deep_copy(): st = SimplexTree() - st .insert([1,2,3], 0.) - a = st.copy() + st.insert([1, 2, 3], 0.) + # persistence is not copied + st.compute_persistence() + + st_copy = st.copy(deep=True) # TODO(VR): when #463 is merged, replace with - # assert a == st - assert a.num_vertices() == st.num_vertices() - assert a.num_simplices() == st.num_simplices() + # assert st_copy == st + assert st_copy.num_vertices() == st.num_vertices() + assert st_copy.num_simplices() == st.num_simplices() st_filt_list = list(st.get_filtration()) - assert list(a.get_filtration()) == st_filt_list + assert list(st_copy.get_filtration()) == st_filt_list + + assert st.__is_persistence_defined() == True + assert st_copy.__is_persistence_defined() == False - a.remove_maximal_simplex([1, 2, 3]) - a_filt_list = list(a.get_filtration()) + st_copy.remove_maximal_simplex([1, 2, 3]) + a_filt_list = list(st_copy.get_filtration()) assert len(a_filt_list) < len(st_filt_list) for a_splx in a_filt_list: assert a_splx in st_filt_list + + # test double free + del st + del st_copy + +def test_simplex_tree_shallow_copy(): + st = SimplexTree() + st.insert([1, 2, 3], 0.) + # persistence is not copied + st.compute_persistence() + + st_copy = st.copy(deep=False) + # TODO(VR): when #463 is merged, replace with + # assert st_copy == st + assert st_copy.num_vertices() == st.num_vertices() + assert st_copy.num_simplices() == st.num_simplices() + assert list(st_copy.get_filtration()) == list(st.get_filtration()) + + assert st.__is_persistence_defined() == True + assert st_copy.__is_persistence_defined() == False + + st_copy.assign_filtration([1, 2, 3], 2.) + assert list(st_copy.get_filtration()) == list(st.get_filtration()) + + # test double free + del st + del st_copy + +def test_simplex_tree_deep_copy_constructor(): + st = SimplexTree() + st.insert([1, 2, 3], 0.) + # persistence is not copied + st.compute_persistence() + + st_copy = SimplexTree(st, copy = True) + # TODO(VR): when #463 is merged, replace with + # assert st_copy == st + assert st_copy.num_vertices() == st.num_vertices() + assert st_copy.num_simplices() == st.num_simplices() + st_filt_list = list(st.get_filtration()) + assert list(st_copy.get_filtration()) == st_filt_list + + assert st.__is_persistence_defined() == True + assert st_copy.__is_persistence_defined() == False + + st_copy.remove_maximal_simplex([1, 2, 3]) + a_filt_list = list(st_copy.get_filtration()) + assert len(a_filt_list) < len(st_filt_list) + + for a_splx in a_filt_list: + assert a_splx in st_filt_list + + # test double free + del st + del st_copy + +def test_simplex_tree_shallow_copy(): + st = SimplexTree() + st.insert([1, 2, 3], 0.) + # persistence is not copied + st.compute_persistence() + + st_copy = SimplexTree(st, copy = False) + # TODO(VR): when #463 is merged, replace with + # assert st_copy == st + assert st_copy.num_vertices() == st.num_vertices() + assert st_copy.num_simplices() == st.num_simplices() + assert list(st_copy.get_filtration()) == list(st.get_filtration()) + + assert st.__is_persistence_defined() == True + assert st_copy.__is_persistence_defined() == False + + st_copy.assign_filtration([1, 2, 3], 2.) + assert list(st_copy.get_filtration()) == list(st.get_filtration()) + + # test double free + del st + del st_copy -- cgit v1.2.3 From 43981a4d487669fe2002337ab62b72dd9e83a64a Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Mon, 14 Feb 2022 11:08:00 +0100 Subject: Remove shallow copy --- .github/next_release.md | 2 +- src/python/gudhi/simplex_tree.pyx | 54 +++++++++++++----------------------- src/python/test/test_simplex_tree.py | 50 ++------------------------------- 3 files changed, 23 insertions(+), 83 deletions(-) (limited to '.github') diff --git a/.github/next_release.md b/.github/next_release.md index 3946404b..3d4761eb 100644 --- a/.github/next_release.md +++ b/.github/next_release.md @@ -14,7 +14,7 @@ Below is a list of changes made since GUDHI 3.5.0: - A more flexible Betti curve class capable of computing exact curves - [Simplex tree](https://gudhi.inria.fr/python/latest/simplex_tree_ref.html) - - `__copy__`, `__deepcopy__`, `copy` and copy constructors + - `__deepcopy__`, `copy` and copy constructors - Installation - Boost ≥ 1.66.0 is now required (was ≥ 1.56.0). diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx index ed7c3b92..0213e363 100644 --- a/src/python/gudhi/simplex_tree.pyx +++ b/src/python/gudhi/simplex_tree.pyx @@ -30,7 +30,6 @@ cdef class SimplexTree: # unfortunately 'cdef public Simplex_tree_interface_full_featured* thisptr' is not possible # Use intptr_t instead to cast the pointer cdef public intptr_t thisptr - cdef bool __thisptr_to_be_deleted # Get the pointer casted as it should be cdef Simplex_tree_interface_full_featured* get_ptr(self) nogil: @@ -39,36 +38,32 @@ cdef class SimplexTree: cdef Simplex_tree_persistence_interface * pcohptr # Fake constructor that does nothing but documenting the constructor - def __init__(self, other = None, copy = True): + def __init__(self, other = None): """SimplexTree constructor. - :param other: If `other` is a SimplexTree (default = None), the SimplexTree is constructed from a deep/shallow copy of `other`. + + :param other: If `other` is a `None` (default value), an empty `SimplexTree` is created. + If `other` is a `SimplexTree`, the `SimplexTree` is constructed from a deep copy of `other`. :type other: SimplexTree - :param copy: If `True`, the copy will be deep and if `False, the copy will be shallow. Default is `True`. - :type copy: bool - :returns: A simplex tree that is a (deep or shallow) copy of itself. + :returns: An empty or a copy simplex tree. :rtype: SimplexTree - :note: copy constructor requires :func:`compute_persistence` to be launched again as the result is not copied. + + :note: If the `SimplexTree` is a copy, it requires :func:`compute_persistence` to be launched again as the + persistence result is not copied. """ # The real cython constructor - def __cinit__(self, other = None, copy = True): + def __cinit__(self, other = None): cdef SimplexTree ostr if other and type(other) is SimplexTree: ostr = other - if copy: - self.thisptr = (new Simplex_tree_interface_full_featured(dereference(ostr.get_ptr()))) - else: - self.thisptr = ostr.thisptr - # Avoid double free - The original is in charge of deletion - self.__thisptr_to_be_deleted = False + self.thisptr = (new Simplex_tree_interface_full_featured(dereference(ostr.get_ptr()))) else: - self.__thisptr_to_be_deleted = True self.thisptr = (new Simplex_tree_interface_full_featured()) def __dealloc__(self): cdef Simplex_tree_interface_full_featured* ptr = self.get_ptr() # Avoid double free - The original is in charge of deletion - if ptr != NULL and self.__thisptr_to_be_deleted: + if ptr != NULL: del ptr if self.pcohptr != NULL: del self.pcohptr @@ -83,33 +78,24 @@ cdef class SimplexTree: """ return self.pcohptr != NULL - def copy(self, deep=True): + def copy(self): """ - :param deep: If `True`, the copy will be deep and if `False`, the copy will be shallow. Default is `True`. - :type deep: bool - :returns: A simplex tree that is a (deep or shallow) copy of itself. + :returns: A simplex tree that is a deep copy of itself. :rtype: SimplexTree - :note: copy requires :func:`compute_persistence` to be launched again as the result is not copied. + + :note: copy requires :func:`compute_persistence` to be launched again as the persistence result is not copied. """ stree = SimplexTree() cdef Simplex_tree_interface_full_featured* stree_ptr cdef Simplex_tree_interface_full_featured* self_ptr=self.get_ptr() - if deep: - with nogil: - stree_ptr = new Simplex_tree_interface_full_featured(dereference(self_ptr)) - - stree.thisptr = (stree_ptr) - else: - stree.thisptr = self.thisptr - # Avoid double free - The original is in charge of deletion - stree.__thisptr_to_be_deleted = False - return stree + with nogil: + stree_ptr = new Simplex_tree_interface_full_featured(dereference(self_ptr)) - def __copy__(self): - return self.copy(deep=False) + stree.thisptr = (stree_ptr) + return stree def __deepcopy__(self): - return self.copy(deep=True) + return self.copy() def filtration(self, simplex): """This function returns the filtration value for a given N-simplex in diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index 6db6d8fb..62dcc865 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -454,7 +454,7 @@ def test_simplex_tree_deep_copy(): # persistence is not copied st.compute_persistence() - st_copy = st.copy(deep=True) + st_copy = st.copy() # TODO(VR): when #463 is merged, replace with # assert st_copy == st assert st_copy.num_vertices() == st.num_vertices() @@ -476,36 +476,13 @@ def test_simplex_tree_deep_copy(): del st del st_copy -def test_simplex_tree_shallow_copy(): - st = SimplexTree() - st.insert([1, 2, 3], 0.) - # persistence is not copied - st.compute_persistence() - - st_copy = st.copy(deep=False) - # TODO(VR): when #463 is merged, replace with - # assert st_copy == st - assert st_copy.num_vertices() == st.num_vertices() - assert st_copy.num_simplices() == st.num_simplices() - assert list(st_copy.get_filtration()) == list(st.get_filtration()) - - assert st.__is_persistence_defined() == True - assert st_copy.__is_persistence_defined() == False - - st_copy.assign_filtration([1, 2, 3], 2.) - assert list(st_copy.get_filtration()) == list(st.get_filtration()) - - # test double free - del st - del st_copy - def test_simplex_tree_deep_copy_constructor(): st = SimplexTree() st.insert([1, 2, 3], 0.) # persistence is not copied st.compute_persistence() - st_copy = SimplexTree(st, copy = True) + st_copy = SimplexTree(st) # TODO(VR): when #463 is merged, replace with # assert st_copy == st assert st_copy.num_vertices() == st.num_vertices() @@ -526,26 +503,3 @@ def test_simplex_tree_deep_copy_constructor(): # test double free del st del st_copy - -def test_simplex_tree_shallow_copy(): - st = SimplexTree() - st.insert([1, 2, 3], 0.) - # persistence is not copied - st.compute_persistence() - - st_copy = SimplexTree(st, copy = False) - # TODO(VR): when #463 is merged, replace with - # assert st_copy == st - assert st_copy.num_vertices() == st.num_vertices() - assert st_copy.num_simplices() == st.num_simplices() - assert list(st_copy.get_filtration()) == list(st.get_filtration()) - - assert st.__is_persistence_defined() == True - assert st_copy.__is_persistence_defined() == False - - st_copy.assign_filtration([1, 2, 3], 2.) - assert list(st_copy.get_filtration()) == list(st.get_filtration()) - - # test double free - del st - del st_copy -- cgit v1.2.3