summaryrefslogtreecommitdiff
path: root/src/python/gudhi/subsampling.pyx
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2020-01-20 16:59:13 +0100
committerMarc Glisse <marc.glisse@inria.fr>2020-01-20 16:59:13 +0100
commit463043e08e9c8938af96d7220a6d5bb77fc064d8 (patch)
tree2b150676eeb8cfa2a0dc3f2a7a1344c1501f87b0 /src/python/gudhi/subsampling.pyx
parenta7f3167ffb465bd6d1e3b9e40bc6f1c35daf87fc (diff)
parent653b8ff129a9676d1bc69ee5231cf12f9aadd7e9 (diff)
Merge remote-tracking branch 'origin/master' into ext
Diffstat (limited to 'src/python/gudhi/subsampling.pyx')
-rw-r--r--src/python/gudhi/subsampling.pyx20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/python/gudhi/subsampling.pyx b/src/python/gudhi/subsampling.pyx
index e0cd1348..c501d16b 100644
--- a/src/python/gudhi/subsampling.pyx
+++ b/src/python/gudhi/subsampling.pyx
@@ -1,9 +1,3 @@
-from cython cimport numeric
-from libcpp.vector cimport vector
-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
@@ -13,6 +7,12 @@ import os
# Modification(s):
# - YYYY/MM Author: Description of the modification
+from cython cimport numeric
+from libcpp.vector cimport vector
+from libcpp.string cimport string
+from libcpp cimport bool
+import os
+
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
@@ -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.")