diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-11-20 09:29:27 +0100 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-11-20 09:29:27 +0100 |
commit | 7008061749a52e9717d550b44efe60173f4128b5 (patch) | |
tree | f0d53c7a5cb849e3d12d03c45935673969cb4fcb /src/python/gudhi/subsampling.pyx | |
parent | 8227cd68d5aa7c9eeda5dd474f2536b896b6f491 (diff) | |
parent | 445a217f4869c62888a20302491b085fbcaabd1b (diff) |
Merge branch 'master' into persistence_graphical_tool_improvements
Diffstat (limited to 'src/python/gudhi/subsampling.pyx')
-rw-r--r-- | src/python/gudhi/subsampling.pyx | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/python/gudhi/subsampling.pyx b/src/python/gudhi/subsampling.pyx index 1135c1fb..e0cd1348 100644 --- a/src/python/gudhi/subsampling.pyx +++ b/src/python/gudhi/subsampling.pyx @@ -4,15 +4,14 @@ from libcpp.string cimport string from libcpp cimport bool import os -""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. - See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. - Author(s): Vincent Rouvreau - - Copyright (C) 2016 Inria - - Modification(s): - - YYYY/MM Author: Description of the modification -""" +# This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. +# See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. +# Author(s): Vincent Rouvreau +# +# Copyright (C) 2016 Inria +# +# Modification(s): +# - YYYY/MM Author: Description of the modification __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" @@ -44,15 +43,15 @@ def choose_n_farthest_points(points=None, off_file='', nb_points=0, starting_poi :param nb_points: Number of points of the subsample. :type nb_points: unsigned. :param starting_point: The iteration starts with the landmark `starting \ - point`,which is the index of the poit to start with. If not set, this \ - index is choosen randomly. + point`,which is the index of the point to start with. If not set, this \ + index is chosen randomly. :type starting_point: unsigned. :returns: The subsample point set. :rtype: vector[vector[double]] """ - if off_file is not '': + if off_file: if os.path.isfile(off_file): - if starting_point is '': + if starting_point == '': return subsampling_n_farthest_points_from_file(str.encode(off_file), nb_points) else: @@ -65,7 +64,7 @@ def choose_n_farthest_points(points=None, off_file='', nb_points=0, starting_poi if points is None: # Empty points points=[] - if starting_point is '': + if starting_point == '': return subsampling_n_farthest_points(points, nb_points) else: return subsampling_n_farthest_points(points, nb_points, @@ -87,7 +86,7 @@ def pick_n_random_points(points=None, off_file='', nb_points=0): :returns: The subsample point set. :rtype: vector[vector[double]] """ - if off_file is not '': + if off_file: if os.path.isfile(off_file): return subsampling_n_random_points_from_file(str.encode(off_file), nb_points) @@ -117,7 +116,7 @@ def sparsify_point_set(points=None, off_file='', min_squared_dist=0.0): :returns: The subsample point set. :rtype: vector[vector[double]] """ - if off_file is not '': + if off_file: if os.path.isfile(off_file): return subsampling_sparsify_points_from_file(str.encode(off_file), min_squared_dist) |