From 8804aa1580c500ed927d65c25e8b78700725338e Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Tue, 8 Nov 2022 22:26:36 +0100 Subject: Clarify doc of RipsComplex.__init__ --- src/python/gudhi/rips_complex.pyx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/python/gudhi/rips_complex.pyx') diff --git a/src/python/gudhi/rips_complex.pyx b/src/python/gudhi/rips_complex.pyx index c3470292..a0924cd6 100644 --- a/src/python/gudhi/rips_complex.pyx +++ b/src/python/gudhi/rips_complex.pyx @@ -45,20 +45,19 @@ cdef class RipsComplex: max_edge_length=float('inf'), sparse=None): """RipsComplex constructor. - :param max_edge_length: Rips value. - :type max_edge_length: float - :param points: A list of points in d-Dimension. - :type points: list of list of float + :type points: List[List[float]] Or :param distance_matrix: A distance matrix (full square or lower triangular). - :type points: list of list of float + :type distance_matrix: List[List[float]] And in both cases + :param max_edge_length: Rips value. + :type max_edge_length: float :param sparse: If this is not None, it switches to building a sparse Rips and represents the approximation parameter epsilon. :type sparse: float -- cgit v1.2.3 From 7c17408897a95a1f74626e8ff0ec8101ac4f92fd Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Tue, 8 Nov 2022 22:36:16 +0100 Subject: Reject positional arguments in RipsComplex.__init__ --- .github/next_release.md | 3 +++ src/python/gudhi/rips_complex.pyx | 4 ++-- src/python/test/test_simplex_generators.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/python/gudhi/rips_complex.pyx') diff --git a/.github/next_release.md b/.github/next_release.md index 81599b2c..d5fcef1c 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.6.0: - [Module](link) - ... +- [Rips complex](https://gudhi.inria.fr/python/latest/rips_complex_user.html) + - Construction now rejects positional arguments, you need to specify `points=X`. + - Installation - c++17 is the new minimal standard to compile the library. This implies Visual Studio minimal version is now 2017. diff --git a/src/python/gudhi/rips_complex.pyx b/src/python/gudhi/rips_complex.pyx index a0924cd6..d748f91e 100644 --- a/src/python/gudhi/rips_complex.pyx +++ b/src/python/gudhi/rips_complex.pyx @@ -41,7 +41,7 @@ cdef class RipsComplex: cdef Rips_complex_interface thisref # Fake constructor that does nothing but documenting the constructor - def __init__(self, points=None, distance_matrix=None, + def __init__(self, *, points=None, distance_matrix=None, max_edge_length=float('inf'), sparse=None): """RipsComplex constructor. @@ -64,7 +64,7 @@ cdef class RipsComplex: """ # The real cython constructor - def __cinit__(self, points=None, distance_matrix=None, + def __cinit__(self, *, points=None, distance_matrix=None, max_edge_length=float('inf'), sparse=None): if sparse is not None: if distance_matrix is not None: diff --git a/src/python/test/test_simplex_generators.py b/src/python/test/test_simplex_generators.py index 8a9b4844..c567d4c1 100755 --- a/src/python/test/test_simplex_generators.py +++ b/src/python/test/test_simplex_generators.py @@ -14,7 +14,7 @@ import numpy as np def test_flag_generators(): pts = np.array([[0, 0], [0, 1.01], [1, 0], [1.02, 1.03], [100, 0], [100, 3.01], [103, 0], [103.02, 3.03]]) - r = gudhi.RipsComplex(pts, max_edge_length=4) + r = gudhi.RipsComplex(points=pts, max_edge_length=4) st = r.create_simplex_tree(max_dimension=50) st.persistence() g = st.flag_persistence_generators() -- cgit v1.2.3