diff options
author | MathieuCarriere <mathieu.carriere3@gmail.com> | 2022-11-21 23:40:07 +0100 |
---|---|---|
committer | MathieuCarriere <mathieu.carriere3@gmail.com> | 2022-11-21 23:40:07 +0100 |
commit | 6341afeb3e4c14cb1e3dc7a4fe0716d213227bf6 (patch) | |
tree | 929b411dae0c80ffa74e2bb271539bd8e2c7607d | |
parent | ffdbd5ced452530c8ee63a50d5bdf1fe797679a9 (diff) | |
parent | 2752ead7b1db5895064f9bb72f81e6e928fcaf7c (diff) |
Merge branch 'master' of https://github.com/GUDHI/gudhi-devel into perslay
-rw-r--r-- | biblio/how_to_cite_gudhi.bib.in | 362 | ||||
-rw-r--r-- | src/Tangential_complex/include/gudhi/Tangential_complex.h | 5 | ||||
-rw-r--r-- | src/python/gudhi/representations/vector_methods.py | 7 | ||||
-rw-r--r-- | src/python/include/Alpha_complex_factory.h | 4 | ||||
-rwxr-xr-x | src/python/test/test_wasserstein_distance.py | 9 |
5 files changed, 197 insertions, 190 deletions
diff --git a/biblio/how_to_cite_gudhi.bib.in b/biblio/how_to_cite_gudhi.bib.in index a1a971fc..02c09dea 100644 --- a/biblio/how_to_cite_gudhi.bib.in +++ b/biblio/how_to_cite_gudhi.bib.in @@ -1,190 +1,190 @@ @book{gudhi:urm -, title = "{GUDHI} User and Reference Manual" -, author = "{The GUDHI Project}" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, year = @GUDHI_VERSION_YEAR@ -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/" +, title = {GUDHI User and Reference Manual} +, author = {The GUDHI Project} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, year = {@GUDHI_VERSION_YEAR@} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/} } @incollection{gudhi:CubicalComplex -, author = "Pawel Dlotko" -, title = "Cubical complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cubical__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Pawel Dlotko} +, title = {Cubical complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cubical__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:FilteredComplexes -, author = "Cl\'ement Maria" -, title = "Filtered Complexes" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__simplex__tree.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Cl{\'{e}}ment Maria} +, title = {Filtered Complexes} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__simplex__tree.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:ToplexMap -, author = "Fran{{\c{c}}ois Godi" -, title = "Toplex map" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__toplex__map.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Fran{\c{c}}ois Godi} +, title = {Toplex map} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__toplex__map.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:SkeletonBlocker -, author = "David Salinas" -, title = "Skeleton-Blocker" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__skbl.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {David Salinas} +, title = {Skeleton-Blocker} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__skbl.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:Contraction -, author = "David Salinas" -, title = "Contraction" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__contr.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {David Salinas} +, title = {Contraction} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__contr.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:AlphaComplex -, author = "Vincent Rouvreau" -, title = "Alpha complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__alpha__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Vincent Rouvreau} +, title = {Alpha complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__alpha__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:CechComplex -, author = "Vincent Rouvreau, Hind Montassif" -, title = "\v{C}ech complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cech__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Vincent Rouvreau and Hind Montassif} +, title = {{\v{C}}ech complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cech__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:RipsComplex -, author = "Cl\'ement Maria, Pawel Dlotko, Vincent Rouvreau, Marc Glisse" -, title = "Rips complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__rips__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Cl{\'{e}}ment Maria and Pawel Dlotko and Vincent Rouvreau and Marc Glisse} +, title = {Rips complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__rips__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:Collapse -, author = "Siddharth Pritam, Marc Glisse" -, title = "Edge collapse" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__edge__collapse.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Siddharth Pritam and Marc Glisse} +, title = {Edge collapse} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__edge__collapse.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:WitnessComplex -, author = "Siargey Kachanovich" -, title = "Witness complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__witness__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Siargey Kachanovich} +, title = {Witness complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__witness__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:CoverComplex -, author = "Mathieu Carri\`ere" -, title = "Cover complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cover__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Mathieu Carri{\`{e}}re} +, title = {Cover complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cover__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:CoxeterTriangulation -, author = "Siargey Kachanovich" -, title = "Coxeter triangulation" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cover__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Siargey Kachanovich} +, title = {Coxeter triangulation} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__cover__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:TangentialComplex -, author = "Cl\'ement Jamin" -, title = "Tangential complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__tangential__complex.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Cl{\'{e}}ment Jamin} +, title = {Tangential complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__tangential__complex.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:PersistentCohomology -, author = "Cl\'ement Maria" -, title = "Persistent Cohomology" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__persistent__cohomology.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Cl{\'{e}}ment Maria} +, title = {Persistent Cohomology} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__persistent__cohomology.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:BottleneckDistance -, author = "Fran{{\c{c}}ois Godi" -, title = "Bottleneck distance" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__bottleneck__distance.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Fran{\c{c}}ois Godi} +, title = {Bottleneck distance} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__bottleneck__distance.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:PersistenceRepresentations -, author = "Pawel Dlotko" -, title = "Persistence representations" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group___persistence__representations.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Pawel Dlotko} +, title = {Persistence representations} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group___persistence__representations.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:SubSampling -, author = "Cl\'ement Jamin, Siargey Kachanovich" -, title = "Subsampling" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__subsampling.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Cl{\'{e}}ment Jamin and Siargey Kachanovich} +, title = {Subsampling} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__subsampling.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:SpatialSearching -, author = "Cl\'ement Jamin" -, title = "Spatial searching" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__spatial__searching.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Cl{\'{e}}ment Jamin} +, title = {Spatial searching} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/doc/@GUDHI_VERSION@/group__spatial__searching.html} +, year = {@GUDHI_VERSION_YEAR@} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -192,71 +192,71 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @incollection{gudhi:WeightedRipsComplex -, author = "Rapha\"el Tinarrage, Yuichi Ike, Masatoshi Takenouchi" -, title = "Weighted Rips Complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/python/@GUDHI_VERSION@/rips_complex_user.html#weighted-rips-complex" -, year = @GUDHI_VERSION_YEAR@ +, author = {Rapha{\"{e}}l Tinarrage and Yuichi Ike and Masatoshi Takenouchi} +, title = {Weighted Rips Complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/python/@GUDHI_VERSION@/rips_complex_user.html#weighted-rips-complex} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:DTMRipsComplex -, author = "Yuichi Ike" -, title = "DTM Rips Complex" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/python/@GUDHI_VERSION@/rips_complex_user.html#dtm-rips-complex" -, year = @GUDHI_VERSION_YEAR@ +, author = {Yuichi Ike} +, title = {DTM Rips Complex} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/python/@GUDHI_VERSION@/rips_complex_user.html#dtm-rips-complex} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:WassersteinDistance -, author = "Theo Lacombe, Marc Glisse" -, title = "Wasserstein distance" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/python/@GUDHI_VERSION@/wasserstein_distance_user.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Th{\'{e}}o Lacombe and Marc Glisse} +, title = {Wasserstein distance} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/python/@GUDHI_VERSION@/wasserstein_distance_user.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:PersistenceRepresentationsScikitlearnInterface -, author = "Mathieu Carri\`ere, Gard Spreemann, Wojciech Reise" -, title = "Persistence representations scikit-learn like interface" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/python/@GUDHI_VERSION@/representations.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Mathieu Carri{\`{e}}re and Gard Spreemann and Wojciech Reise} +, title = {Persistence representations scikit-learn like interface} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/python/@GUDHI_VERSION@/representations.html} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:Atol -, author = "Martin Royer" -, title = "Measure Vectorization for Automatic Topologically-Oriented Learning" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/python/@GUDHI_VERSION@/representations.html#gudhi.representations.vector_methods.Atol" -, year = @GUDHI_VERSION_YEAR@ +, author = {Martin Royer} +, title = {Measure Vectorization for Automatic Topologically-Oriented Learning} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/python/@GUDHI_VERSION@/representations.html#gudhi.representations.vector_methods.Atol} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:DistanceToMeasure -, author = "Marc Glisse" -, title = "Distance to measure" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/python/@GUDHI_VERSION@/point_cloud.html#module-gudhi.point_cloud.knn" -, year = @GUDHI_VERSION_YEAR@ +, author = {Marc Glisse} +, title = {Distance to measure} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/python/@GUDHI_VERSION@/point_cloud.html#module-gudhi.point_cloud.knn} +, year = {@GUDHI_VERSION_YEAR@} } @incollection{gudhi:PersistenceBasedClustering -, author = "Marc Glisse" -, title = "persistence-based clustering" -, publisher = "{GUDHI Editorial Board}" -, edition = "{@GUDHI_VERSION@}" -, booktitle = "{GUDHI} User and Reference Manual" -, url = "https://gudhi.inria.fr/python/@GUDHI_VERSION@/clustering.html" -, year = @GUDHI_VERSION_YEAR@ +, author = {Marc Glisse} +, title = {persistence-based clustering} +, publisher = {GUDHI Editorial Board} +, edition = {@GUDHI_VERSION@} +, booktitle = {GUDHI User and Reference Manual} +, url = {https://gudhi.inria.fr/python/@GUDHI_VERSION@/clustering.html} +, year = {@GUDHI_VERSION_YEAR@} } diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index 56a24af0..b448db2d 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -345,10 +345,11 @@ class Tangential_complex { m_stars.resize(m_points.size()); m_squared_star_spheres_radii_incl_margin.resize(m_points.size(), FT(-1)); #ifdef GUDHI_TC_PERTURB_POSITION - if (m_points.empty()) + if (m_points.empty()) { m_translations.clear(); - else + } else { m_translations.resize(m_points.size(), m_k.construct_vector_d_object()(m_ambient_dim)); + } #if defined(GUDHI_USE_TBB) delete[] m_p_perturb_mutexes; m_p_perturb_mutexes = new Mutex_for_perturb[m_points.size()]; diff --git a/src/python/gudhi/representations/vector_methods.py b/src/python/gudhi/representations/vector_methods.py index a169aee8..d52185ef 100644 --- a/src/python/gudhi/representations/vector_methods.py +++ b/src/python/gudhi/representations/vector_methods.py @@ -13,8 +13,13 @@ import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from sklearn.exceptions import NotFittedError from sklearn.preprocessing import MinMaxScaler, MaxAbsScaler -from sklearn.neighbors import DistanceMetric from sklearn.metrics import pairwise +try: + # New location since 1.0 + from sklearn.metrics import DistanceMetric +except ImportError: + # Will be removed in 1.3 + from sklearn.neighbors import DistanceMetric from .preprocessing import DiagramScaler, BirthPersistenceTransform diff --git a/src/python/include/Alpha_complex_factory.h b/src/python/include/Alpha_complex_factory.h index 3d20aa8f..41eb72c1 100644 --- a/src/python/include/Alpha_complex_factory.h +++ b/src/python/include/Alpha_complex_factory.h @@ -106,7 +106,7 @@ class Exact_alpha_complex_dD final : public Abstract_alpha_complex { return alpha_complex_.create_complex(*simplex_tree, max_alpha_square, exact_version_, default_filtration_value); } - virtual std::size_t num_vertices() const { + virtual std::size_t num_vertices() const override { return alpha_complex_.num_vertices(); } @@ -141,7 +141,7 @@ class Inexact_alpha_complex_dD final : public Abstract_alpha_complex { return alpha_complex_.create_complex(*simplex_tree, max_alpha_square, false, default_filtration_value); } - virtual std::size_t num_vertices() const { + virtual std::size_t num_vertices() const override { return alpha_complex_.num_vertices(); } diff --git a/src/python/test/test_wasserstein_distance.py b/src/python/test/test_wasserstein_distance.py index 3a004d77..a76b6ce7 100755 --- a/src/python/test/test_wasserstein_distance.py +++ b/src/python/test/test_wasserstein_distance.py @@ -90,10 +90,11 @@ def test_get_essential_parts(): def test_warn_infty(): - assert _warn_infty(matching=False)==np.inf - c, m = _warn_infty(matching=True) - assert (c == np.inf) - assert (m is None) + with pytest.warns(UserWarning): + assert _warn_infty(matching=False)==np.inf + c, m = _warn_infty(matching=True) + assert (c == np.inf) + assert (m is None) def _basic_wasserstein(wasserstein_distance, delta, test_infinity=True, test_matching=True): |