summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeGUDHIVersion.txt2
-rw-r--r--next_release.md30
-rwxr-xr-xsrc/python/example/alpha_complex_from_points_example.py7
-rw-r--r--src/python/gudhi/alpha_complex.pyx11
-rw-r--r--src/python/gudhi/euclidean_strong_witness_complex.pyx4
-rw-r--r--src/python/gudhi/euclidean_witness_complex.pyx4
-rw-r--r--src/python/gudhi/rips_complex.pyx2
-rw-r--r--src/python/gudhi/simplex_tree.pxd2
-rw-r--r--src/python/gudhi/strong_witness_complex.pyx4
-rw-r--r--src/python/gudhi/witness_complex.pyx4
-rw-r--r--src/python/include/Alpha_complex_interface.h10
-rwxr-xr-xsrc/python/test/test_alpha_complex.py28
12 files changed, 60 insertions, 48 deletions
diff --git a/CMakeGUDHIVersion.txt b/CMakeGUDHIVersion.txt
index 8300b75e..ed19ecfb 100644
--- a/CMakeGUDHIVersion.txt
+++ b/CMakeGUDHIVersion.txt
@@ -1,6 +1,6 @@
set (GUDHI_MAJOR_VERSION 3)
set (GUDHI_MINOR_VERSION 1)
-set (GUDHI_PATCH_VERSION 0.rc1)
+set (GUDHI_PATCH_VERSION 0)
set(GUDHI_VERSION ${GUDHI_MAJOR_VERSION}.${GUDHI_MINOR_VERSION}.${GUDHI_PATCH_VERSION})
message(STATUS "GUDHI version : ${GUDHI_VERSION}")
diff --git a/next_release.md b/next_release.md
index 6d749886..26d4fca5 100644
--- a/next_release.md
+++ b/next_release.md
@@ -1,31 +1,23 @@
-We are pleased to announce the release 3.1.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 2 new Python modules: Persistence representations and Wasserstein distance.
+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.1.0.rc1.tar.gz).
+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.0.0:
+Below is a list of changes made since Gudhi 3.1.0:
-- [Persistence representations](https://gudhi.inria.fr/python/3.1.0.rc1/representations.html) (new Python module)
- - Vectorizations, distances and kernels that work on persistence diagrams, compatible with scikit-learn. This module was originally available at https://github.com/MathieuCarriere/sklearn-tda and named sklearn_tda.
+- [Module](link)
+ - ...
-- [Wasserstein distance](https://gudhi.inria.fr/python/3.1.0.rc1/wasserstein_distance_user.html) (new Python module)
- - The q-Wasserstein distance measures the similarity between two persistence diagrams.
-
-- [Alpha complex](https://gudhi.inria.fr/doc/3.1.0.rc1/group__alpha__complex.html) (new C++ interface)
- - Thanks to [CGAL 5.0 Epeck_d](https://doc.cgal.org/latest/Kernel_d/structCGAL_1_1Epeck__d.html) kernel, an exact computation version of Alpha complex dD is available and the default one (even in Python).
-
-- [Persistence graphical tools](https://gudhi.inria.fr/python/3.1.0.rc1/persistence_graphical_tools_user.html) (new Python interface)
- - Axes as a parameter allows the user to subplot graphics.
- - Use matplotlib default palette (can be user defined).
+- [Module](link)
+ - ...
- Miscellaneous
- - Python `read_off` function has been renamed `read_points_from_off_file` as it only read points from OFF files.
- - See the list of [bug fixes](https://github.com/GUDHI/gudhi-devel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A3.1.0+).
+ - See the list of [bug fixes](https://github.com/GUDHI/gudhi-devel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A3.X.X+).
All modules are distributed under the terms of the MIT license.
-There are still GPL dependencies for many modules, and so for an end-user it doesn't necessarily change much. We invite you to check our [license dedicated web page](https://gudhi.inria.fr/licensing/) for further details about this change.
+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.
We kindly ask users to cite the GUDHI library as appropriately as possible in their papers, and to mention the use of the GUDHI library on the web pages of their projects using GUDHI and provide us with links to these web pages.
@@ -33,4 +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/3.1.0.rc1/installation.html) or [Python](https://gudhi.inria.fr/python/3.1.0.rc1/installation.html)), please visit the [GUDHI web site](https://gudhi.inria.fr/). \ No newline at end of file
+For further information about downloading and installing the library ([C++](https://gudhi.inria.fr/doc/3.1.0.rc1/installation.html) or [Python](https://gudhi.inria.fr/python/3.1.0.rc1/installation.html)), please visit the [GUDHI web site](https://gudhi.inria.fr/).
diff --git a/src/python/example/alpha_complex_from_points_example.py b/src/python/example/alpha_complex_from_points_example.py
index a746998c..844d7a82 100755
--- a/src/python/example/alpha_complex_from_points_example.py
+++ b/src/python/example/alpha_complex_from_points_example.py
@@ -52,4 +52,9 @@ print("star([0])=", simplex_tree.get_star([0]))
print("coface([0], 1)=", simplex_tree.get_cofaces([0], 1))
print("point[0]=", alpha_complex.get_point(0))
-print("point[5]=", alpha_complex.get_point(5))
+try:
+ print("point[5]=", alpha_complex.get_point(5))
+except IndexError:
+ pass
+else:
+ assert False
diff --git a/src/python/gudhi/alpha_complex.pyx b/src/python/gudhi/alpha_complex.pyx
index f3ca3dd5..fff3e920 100644
--- a/src/python/gudhi/alpha_complex.pyx
+++ b/src/python/gudhi/alpha_complex.pyx
@@ -24,11 +24,11 @@ __license__ = "GPL v3"
cdef extern from "Alpha_complex_interface.h" namespace "Gudhi":
cdef cppclass Alpha_complex_interface "Gudhi::alpha_complex::Alpha_complex_interface":
- Alpha_complex_interface(vector[vector[double]] points)
+ Alpha_complex_interface(vector[vector[double]] points) except +
# bool from_file is a workaround for cython to find the correct signature
- Alpha_complex_interface(string off_file, bool from_file)
- vector[double] get_point(int vertex)
- void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square)
+ Alpha_complex_interface(string off_file, bool from_file) except +
+ vector[double] get_point(int vertex) except +
+ void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) except +
# AlphaComplex python interface
cdef class AlphaComplex:
@@ -96,8 +96,7 @@ cdef class AlphaComplex:
:rtype: list of float
:returns: the point.
"""
- cdef vector[double] point = self.thisptr.get_point(vertex)
- return point
+ return self.thisptr.get_point(vertex)
def create_simplex_tree(self, max_alpha_square = float('inf')):
"""
diff --git a/src/python/gudhi/euclidean_strong_witness_complex.pyx b/src/python/gudhi/euclidean_strong_witness_complex.pyx
index 9889f92c..aca6084e 100644
--- a/src/python/gudhi/euclidean_strong_witness_complex.pyx
+++ b/src/python/gudhi/euclidean_strong_witness_complex.pyx
@@ -22,9 +22,9 @@ __license__ = "GPL v3"
cdef extern from "Euclidean_strong_witness_complex_interface.h" namespace "Gudhi":
cdef cppclass Euclidean_strong_witness_complex_interface "Gudhi::witness_complex::Euclidean_strong_witness_complex_interface":
Euclidean_strong_witness_complex_interface(vector[vector[double]] landmarks, vector[vector[double]] witnesses)
- void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square)
+ void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) except +
void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square,
- unsigned limit_dimension)
+ unsigned limit_dimension) except +
vector[double] get_point(unsigned vertex)
# EuclideanStrongWitnessComplex python interface
diff --git a/src/python/gudhi/euclidean_witness_complex.pyx b/src/python/gudhi/euclidean_witness_complex.pyx
index e3ce0e82..fb0c2201 100644
--- a/src/python/gudhi/euclidean_witness_complex.pyx
+++ b/src/python/gudhi/euclidean_witness_complex.pyx
@@ -22,9 +22,9 @@ __license__ = "GPL v3"
cdef extern from "Euclidean_witness_complex_interface.h" namespace "Gudhi":
cdef cppclass Euclidean_witness_complex_interface "Gudhi::witness_complex::Euclidean_witness_complex_interface":
Euclidean_witness_complex_interface(vector[vector[double]] landmarks, vector[vector[double]] witnesses)
- void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square)
+ void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) except +
void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square,
- unsigned limit_dimension)
+ unsigned limit_dimension) except +
vector[double] get_point(unsigned vertex)
# EuclideanWitnessComplex python interface
diff --git a/src/python/gudhi/rips_complex.pyx b/src/python/gudhi/rips_complex.pyx
index 722cdcdc..deb8057a 100644
--- a/src/python/gudhi/rips_complex.pyx
+++ b/src/python/gudhi/rips_complex.pyx
@@ -28,7 +28,7 @@ cdef extern from "Rips_complex_interface.h" namespace "Gudhi":
void init_matrix(vector[vector[double]] values, double threshold)
void init_points_sparse(vector[vector[double]] values, double threshold, double sparse)
void init_matrix_sparse(vector[vector[double]] values, double threshold, double sparse)
- void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, int dim_max)
+ void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, int dim_max) except +
# RipsComplex python interface
cdef class RipsComplex:
diff --git a/src/python/gudhi/simplex_tree.pxd b/src/python/gudhi/simplex_tree.pxd
index 1066d44b..96d14079 100644
--- a/src/python/gudhi/simplex_tree.pxd
+++ b/src/python/gudhi/simplex_tree.pxd
@@ -39,7 +39,7 @@ cdef extern from "Simplex_tree_interface.h" namespace "Gudhi":
vector[pair[vector[int], double]] get_star(vector[int] simplex)
vector[pair[vector[int], double]] get_cofaces(vector[int] simplex,
int dimension)
- void expansion(int max_dim)
+ void expansion(int max_dim) except +
void remove_maximal_simplex(vector[int] simplex)
bool prune_above_filtration(double filtration)
bool make_filtration_non_decreasing()
diff --git a/src/python/gudhi/strong_witness_complex.pyx b/src/python/gudhi/strong_witness_complex.pyx
index 2c33c3f2..9f89d3ae 100644
--- a/src/python/gudhi/strong_witness_complex.pyx
+++ b/src/python/gudhi/strong_witness_complex.pyx
@@ -22,9 +22,9 @@ __license__ = "MIT"
cdef extern from "Strong_witness_complex_interface.h" namespace "Gudhi":
cdef cppclass Strong_witness_complex_interface "Gudhi::witness_complex::Strong_witness_complex_interface":
Strong_witness_complex_interface(vector[vector[pair[size_t, double]]] nearest_landmark_table)
- void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square)
+ void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) except +
void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square,
- unsigned limit_dimension)
+ unsigned limit_dimension) except +
# StrongWitnessComplex python interface
cdef class StrongWitnessComplex:
diff --git a/src/python/gudhi/witness_complex.pyx b/src/python/gudhi/witness_complex.pyx
index b032a5a1..e589d006 100644
--- a/src/python/gudhi/witness_complex.pyx
+++ b/src/python/gudhi/witness_complex.pyx
@@ -22,9 +22,9 @@ __license__ = "MIT"
cdef extern from "Witness_complex_interface.h" namespace "Gudhi":
cdef cppclass Witness_complex_interface "Gudhi::witness_complex::Witness_complex_interface":
Witness_complex_interface(vector[vector[pair[size_t, double]]] nearest_landmark_table)
- void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square)
+ void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) except +
void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square,
- unsigned limit_dimension)
+ unsigned limit_dimension) except +
# WitnessComplex python interface
cdef class WitnessComplex:
diff --git a/src/python/include/Alpha_complex_interface.h b/src/python/include/Alpha_complex_interface.h
index e9bbadb0..8614eee3 100644
--- a/src/python/include/Alpha_complex_interface.h
+++ b/src/python/include/Alpha_complex_interface.h
@@ -50,13 +50,9 @@ class Alpha_complex_interface {
std::vector<double> get_point(int vh) {
std::vector<double> vd;
- try {
- Point_d const& ph = alpha_complex_->get_point(vh);
- for (auto coord = ph.cartesian_begin(); coord != ph.cartesian_end(); coord++)
- vd.push_back(CGAL::to_double(*coord));
- } catch (std::out_of_range const&) {
- // std::out_of_range is thrown in case not found. Other exceptions must be re-thrown
- }
+ Point_d const& ph = alpha_complex_->get_point(vh);
+ for (auto coord = ph.cartesian_begin(); coord != ph.cartesian_end(); coord++)
+ vd.push_back(CGAL::to_double(*coord));
return vd;
}
diff --git a/src/python/test/test_alpha_complex.py b/src/python/test/test_alpha_complex.py
index 0d9e9e45..3761fe16 100755
--- a/src/python/test/test_alpha_complex.py
+++ b/src/python/test/test_alpha_complex.py
@@ -65,8 +65,18 @@ def test_infinite_alpha():
assert point_list[1] == alpha_complex.get_point(1)
assert point_list[2] == alpha_complex.get_point(2)
assert point_list[3] == alpha_complex.get_point(3)
- assert alpha_complex.get_point(4) == []
- assert alpha_complex.get_point(125) == []
+ try:
+ alpha_complex.get_point(4) == []
+ except IndexError:
+ pass
+ else:
+ assert False
+ try:
+ alpha_complex.get_point(125) == []
+ except IndexError:
+ pass
+ else:
+ assert False
def test_filtered_alpha():
@@ -82,8 +92,18 @@ def test_filtered_alpha():
assert point_list[1] == filtered_alpha.get_point(1)
assert point_list[2] == filtered_alpha.get_point(2)
assert point_list[3] == filtered_alpha.get_point(3)
- assert filtered_alpha.get_point(4) == []
- assert filtered_alpha.get_point(125) == []
+ try:
+ filtered_alpha.get_point(4) == []
+ except IndexError:
+ pass
+ else:
+ assert False
+ try:
+ filtered_alpha.get_point(125) == []
+ except IndexError:
+ pass
+ else:
+ assert False
assert simplex_tree.get_filtration() == [
([0], 0.0),