summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2021-06-09 11:47:34 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2021-06-09 11:47:34 +0200
commitf1effb5b5bf30275a692b51528ec068f7cef84ab (patch)
treecfdc0cde75cb233d08d24629b80539a662faf2c4
parentafd0a890b39e40cd3ce358c647ae5e77eb288e07 (diff)
doc review: use 120 characters per line and warning about the numbering of vertices for 3d version
-rw-r--r--src/python/doc/alpha_complex_user.rst10
-rw-r--r--src/python/gudhi/alpha_complex.pyx33
-rw-r--r--src/python/gudhi/alpha_complex_3d.pyx31
3 files changed, 34 insertions, 40 deletions
diff --git a/src/python/doc/alpha_complex_user.rst b/src/python/doc/alpha_complex_user.rst
index 985ee962..e615d0be 100644
--- a/src/python/doc/alpha_complex_user.rst
+++ b/src/python/doc/alpha_complex_user.rst
@@ -34,8 +34,6 @@ Remarks
the computation of filtration values can exceptionally be arbitrarily bad. In all cases, we still guarantee that the
output is a valid filtration (faces have a filtration value no larger than their cofaces).
* For performances reasons, it is advised to use Alpha_complex with `CGAL <installation.html#cgal>`_ :math:`\geq` 5.0.0.
-* The vertices in the output simplex tree are not guaranteed to match the order of the input points. One can use
- :func:`~gudhi.AlphaComplex.get_point` to get the initial point back.
Example from points
-------------------
@@ -264,4 +262,10 @@ Then, it computes the persistence diagram and displays it:
:Requires: `Eigen <installation.html#eigen>`_ :math:`\geq` 3.1.0 and `CGAL <installation.html#cgal>`_ :math:`\geq` 4.11.0.
A specific module for Alpha complex is available in 3d (cf. :class:`~gudhi.AlphaComplex3D`) and
-allows to construct standard and weighted versions of alpha complexes. \ No newline at end of file
+allows to construct standard and weighted versions of alpha complexes.
+
+Remark
+""""""
+
+* Contrary to the dD version, with the 3d version, the vertices in the output simplex tree are not guaranteed to match
+ the order of the input points. One can use :func:`~gudhi.AlphaComplex3D.get_point` to get the initial point back.
diff --git a/src/python/gudhi/alpha_complex.pyx b/src/python/gudhi/alpha_complex.pyx
index caebfab0..2cf4738b 100644
--- a/src/python/gudhi/alpha_complex.pyx
+++ b/src/python/gudhi/alpha_complex.pyx
@@ -36,22 +36,18 @@ cdef extern from "Alpha_complex_interface.h" namespace "Gudhi":
# AlphaComplex python interface
cdef class AlphaComplex:
- """AlphaComplex is a simplicial complex constructed from the finite cells
- of a Delaunay Triangulation.
+ """AlphaComplex is a simplicial complex constructed from the finite cells of a Delaunay Triangulation.
- The filtration value of each simplex is computed as the square of the
- circumradius of the simplex if the circumsphere is empty (the simplex is
- then said to be Gabriel), and as the minimum of the filtration values of
- the codimension 1 cofaces that make it not Gabriel otherwise.
+ The filtration value of each simplex is computed as the square of the circumradius of the simplex if the
+ circumsphere is empty (the simplex is then said to be Gabriel), and as the minimum of the filtration values of the
+ codimension 1 cofaces that make it not Gabriel otherwise.
- All simplices that have a filtration value strictly greater than a given
- alpha squared value are not inserted into the complex.
+ All simplices that have a filtration value strictly greater than a given alpha squared value are not inserted into
+ the complex.
.. note::
- When Alpha_complex is constructed with an infinite value of alpha, the
- complex is a Delaunay complex.
-
+ When Alpha_complex is constructed with an infinite value of alpha, the complex is a Delaunay complex.
"""
cdef Alpha_complex_interface * this_ptr
@@ -63,18 +59,14 @@ cdef class AlphaComplex:
:param points: A list of points in d-Dimension.
:type points: Iterable[Iterable[float]]
- :param off_file: **[deprecated]** An `OFF file style <fileformats.html#off-file-format>`_
- name.
- If an `off_file` is given with `points` as arguments, only points from the file are
- taken into account.
+ :param off_file: **[deprecated]** An `OFF file style <fileformats.html#off-file-format>`_ name.
+ If an `off_file` is given with `points` as arguments, only points from the file are taken into account.
:type off_file: string
- :param weights: A list of weights. If set, the number of weights must correspond to the
- number of points.
+ :param weights: A list of weights. If set, the number of weights must correspond to the number of points.
:type weights: Iterable[float]
- :param precision: Alpha complex precision can be 'fast', 'safe' or 'exact'. Default is
- 'safe'.
+ :param precision: Alpha complex precision can be 'fast', 'safe' or 'exact'. Default is 'safe'.
:type precision: string
:raises FileNotFoundError: **[deprecated]** If `off_file` is set but not found.
@@ -83,8 +75,7 @@ cdef class AlphaComplex:
# The real cython constructor
def __cinit__(self, points = [], off_file = '', weights=None, precision = 'safe'):
- assert precision in ['fast', 'safe', 'exact'], \
- "Alpha complex precision can only be 'fast', 'safe' or 'exact'"
+ assert precision in ['fast', 'safe', 'exact'], "Alpha complex precision can only be 'fast', 'safe' or 'exact'"
cdef bool fast = precision == 'fast'
cdef bool exact = precision == 'exact'
diff --git a/src/python/gudhi/alpha_complex_3d.pyx b/src/python/gudhi/alpha_complex_3d.pyx
index 3959004a..4d3fe59c 100644
--- a/src/python/gudhi/alpha_complex_3d.pyx
+++ b/src/python/gudhi/alpha_complex_3d.pyx
@@ -36,22 +36,24 @@ cdef extern from "Alpha_complex_interface_3d.h" namespace "Gudhi":
# AlphaComplex3D python interface
cdef class AlphaComplex3D:
- """AlphaComplex3D is a simplicial complex constructed from the finite cells
- of a Delaunay Triangulation.
+ """AlphaComplex3D is a simplicial complex constructed from the finite cells of a Delaunay Triangulation.
- The filtration value of each simplex is computed as the square of the
- circumradius of the simplex if the circumsphere is empty (the simplex is
- then said to be Gabriel), and as the minimum of the filtration values of
- the codimension 1 cofaces that make it not Gabriel otherwise.
+ The filtration value of each simplex is computed as the square of the circumradius of the simplex if the
+ circumsphere is empty (the simplex is then said to be Gabriel), and as the minimum of the filtration values of the
+ codimension 1 cofaces that make it not Gabriel otherwise.
- All simplices that have a filtration value strictly greater than a given
- alpha squared value are not inserted into the complex.
+ All simplices that have a filtration value strictly greater than a given alpha squared value are not inserted into
+ the complex.
.. note::
- When AlphaComplex3D is constructed with an infinite value of alpha, the
- complex is a Delaunay complex.
+ When AlphaComplex3D is constructed with an infinite value of alpha, the complex is a Delaunay complex.
+ .. warning::
+
+ Contrary to the dD version, with the 3d version, the vertices in the output simplex tree are not guaranteed to
+ match the order of the input points. One can use :func:`~gudhi.AlphaComplex3D.get_point` to get the initial
+ point back.
"""
cdef Alpha_complex_interface_3d * this_ptr
@@ -63,12 +65,10 @@ cdef class AlphaComplex3D:
:param points: A list of points in d-Dimension.
:type points: Iterable[Iterable[float]]
- :param weights: A list of weights. If set, the number of weights must correspond to the
- number of points.
+ :param weights: A list of weights. If set, the number of weights must correspond to the number of points.
:type weights: Iterable[float]
- :param precision: Alpha complex precision can be 'fast', 'safe' or 'exact'. Default is
- 'safe'.
+ :param precision: Alpha complex precision can be 'fast', 'safe' or 'exact'. Default is 'safe'.
:type precision: string
:raises ValueError: In case of inconsistency between the number of points and weights.
@@ -76,8 +76,7 @@ cdef class AlphaComplex3D:
# The real cython constructor
def __cinit__(self, points = [], weights=[], precision = 'safe'):
- assert precision in ['fast', 'safe', 'exact'], \
- "Alpha complex precision can only be 'fast', 'safe' or 'exact'"
+ assert precision in ['fast', 'safe', 'exact'], "Alpha complex precision can only be 'fast', 'safe' or 'exact'"
cdef bool fast = precision == 'fast'
cdef bool exact = precision == 'exact'