summaryrefslogtreecommitdiff
path: root/src/python/gudhi/subsampling.pyx
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-15 10:23:58 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-15 10:23:58 +0100
commitd747facccbe835be1384e569cf3d6e4c335c0364 (patch)
treec96f825a731b82f7240b2ffc81a57a8dd2bffa92 /src/python/gudhi/subsampling.pyx
parente1255fe356f1ff97533b33caa6179737a64c4898 (diff)
In python2, does not work. is ok for Python 2 and 3
Diffstat (limited to 'src/python/gudhi/subsampling.pyx')
-rw-r--r--src/python/gudhi/subsampling.pyx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/python/gudhi/subsampling.pyx b/src/python/gudhi/subsampling.pyx
index b1812087..c501d16b 100644
--- a/src/python/gudhi/subsampling.pyx
+++ b/src/python/gudhi/subsampling.pyx
@@ -52,10 +52,10 @@ def choose_n_farthest_points(points=None, off_file='', nb_points=0, starting_poi
if off_file:
if os.path.isfile(off_file):
if starting_point == '':
- return subsampling_n_farthest_points_from_file(str.encode(off_file),
+ return subsampling_n_farthest_points_from_file(off_file.encode('utf-8'),
nb_points)
else:
- return subsampling_n_farthest_points_from_file(str.encode(off_file),
+ return subsampling_n_farthest_points_from_file(off_file.encode('utf-8'),
nb_points,
starting_point)
else:
@@ -88,7 +88,7 @@ def pick_n_random_points(points=None, off_file='', nb_points=0):
"""
if off_file:
if os.path.isfile(off_file):
- return subsampling_n_random_points_from_file(str.encode(off_file),
+ return subsampling_n_random_points_from_file(off_file.encode('utf-8'),
nb_points)
else:
print("file " + off_file + " not found.")
@@ -118,7 +118,7 @@ def sparsify_point_set(points=None, off_file='', min_squared_dist=0.0):
"""
if off_file:
if os.path.isfile(off_file):
- return subsampling_sparsify_points_from_file(str.encode(off_file),
+ return subsampling_sparsify_points_from_file(off_file.encode('utf-8'),
min_squared_dist)
else:
print("file " + off_file + " not found.")