From 18c98020adea4a7d0c53fe4e76c92bab23e7ad76 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 9 Jan 2020 18:03:39 +0100 Subject: Spell out types as in PEP 484 but don't actually use annotations. A quick try with sphinx-autodoc-typehints failed, I didn't investigate much, it can wait. --- src/python/gudhi/off_reader.pyx | 2 +- src/python/gudhi/reader_utils.pyx | 6 +++--- src/python/gudhi/subsampling.pyx | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/python') diff --git a/src/python/gudhi/off_reader.pyx b/src/python/gudhi/off_reader.pyx index e45356be..3a31eba6 100644 --- a/src/python/gudhi/off_reader.pyx +++ b/src/python/gudhi/off_reader.pyx @@ -26,7 +26,7 @@ def read_off(off_file=''): :type off_file: string :returns: The point set. - :rtype: list(list(float)) + :rtype: List[List[float]] """ if off_file: if os.path.isfile(off_file): diff --git a/src/python/gudhi/reader_utils.pyx b/src/python/gudhi/reader_utils.pyx index 5a756e4b..9ced6bca 100644 --- a/src/python/gudhi/reader_utils.pyx +++ b/src/python/gudhi/reader_utils.pyx @@ -34,7 +34,7 @@ def read_lower_triangular_matrix_from_csv_file(csv_file='', separator=';'): :type separator: char :returns: The lower triangular matrix. - :rtype: list(list(float)) + :rtype: List[List[float]] """ if csv_file: if path.isfile(csv_file): @@ -46,14 +46,14 @@ def read_persistence_intervals_grouped_by_dimension(persistence_file=''): """Reads a file containing persistence intervals. Each line might contain 2, 3 or 4 values: [[field] dimension] birth death The return value is a `dict(dim, list(tuple(birth, death)))` - where `dim` is an `int`, `birth` a `double`, and `death` a `double`. + where `dim` is an `int`, `birth` a `float`, and `death` a `float`. Note: the function does not check that birth <= death. :param persistence_file: A persistence file style name. :type persistence_file: string :returns: The persistence pairs grouped by dimension. - :rtype: dict(int, list(tuple(float, float))) + :rtype: Dict[int, List[Tuple[float, float]]] """ if persistence_file: if path.isfile(persistence_file): diff --git a/src/python/gudhi/subsampling.pyx b/src/python/gudhi/subsampling.pyx index 04f66219..f50f4b0c 100644 --- a/src/python/gudhi/subsampling.pyx +++ b/src/python/gudhi/subsampling.pyx @@ -33,7 +33,7 @@ def choose_n_farthest_points(points=None, off_file='', nb_points=0, starting_poi The iteration starts with the landmark `starting point`. :param points: The input point set. - :type points: list(list(float)). + :type points: Iterable[Iterable[float]]. Or @@ -47,7 +47,7 @@ def choose_n_farthest_points(points=None, off_file='', nb_points=0, starting_poi index is chosen randomly. :type starting_point: unsigned. :returns: The subsample point set. - :rtype: list(list(float)). + :rtype: List[List[float]]. """ if off_file: if os.path.isfile(off_file): @@ -74,7 +74,7 @@ def pick_n_random_points(points=None, off_file='', nb_points=0): """Subsample a point set by picking random vertices. :param points: The input point set. - :type points: list(list(float)). + :type points: Iterable[Iterable[float]]. Or @@ -84,7 +84,7 @@ def pick_n_random_points(points=None, off_file='', nb_points=0): :param nb_points: Number of points of the subsample. :type nb_points: unsigned. :returns: The subsample point set. - :rtype: list(list(float)) + :rtype: List[List[float]] """ if off_file: if os.path.isfile(off_file): @@ -103,7 +103,7 @@ def sparsify_point_set(points=None, off_file='', min_squared_dist=0.0): between any two points is greater than or equal to min_squared_dist. :param points: The input point set. - :type points: list(list(float)). + :type points: Iterable[Iterable[float]]. Or @@ -114,7 +114,7 @@ def sparsify_point_set(points=None, off_file='', min_squared_dist=0.0): points. :type min_squared_dist: float. :returns: The subsample point set. - :rtype: list(list(float)) + :rtype: List[List[float]] """ if off_file: if os.path.isfile(off_file): -- cgit v1.2.3