summaryrefslogtreecommitdiff
path: root/src/python/gudhi/subsampling.pyx
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2019-11-09 21:03:13 +0100
committerMarc Glisse <marc.glisse@inria.fr>2019-11-09 21:03:13 +0100
commitd091cf5369c2eba0bb301942842d56606a45af76 (patch)
tree25eeda58d913cf25b096f77ebc26d5335bfa1007 /src/python/gudhi/subsampling.pyx
parentdb405e686cc859e510b894dca45562158cb5c963 (diff)
Replace 'is' with == or similar.
Related to issue #113, but I did not touch persistence_graphical_tools.py which is handled in PR #119. I don't know if I got them all, I guess we'll start seeing the warnings with python-3.8 soon enough.
Diffstat (limited to 'src/python/gudhi/subsampling.pyx')
-rw-r--r--src/python/gudhi/subsampling.pyx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/python/gudhi/subsampling.pyx b/src/python/gudhi/subsampling.pyx
index 1135c1fb..e622ac99 100644
--- a/src/python/gudhi/subsampling.pyx
+++ b/src/python/gudhi/subsampling.pyx
@@ -44,15 +44,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 +65,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 +87,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 +117,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)