summaryrefslogtreecommitdiff
path: root/src/python/gudhi/alpha_complex.pyx
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-27 10:40:34 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-27 10:40:34 +0100
commitc7b70317b643b2eb9c603602da9c979388829821 (patch)
treeb6902eb51b29d0033f086f80ba3cb5d82c11c9d8 /src/python/gudhi/alpha_complex.pyx
parent6e9211cccad31145a5675a33689b167008ac1ffa (diff)
parent5d5f40493ce60f2a606793645bf713c60fb5284d (diff)
Merge branch 'master' into print_warnings_to_stderr
Diffstat (limited to 'src/python/gudhi/alpha_complex.pyx')
-rw-r--r--src/python/gudhi/alpha_complex.pyx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/python/gudhi/alpha_complex.pyx b/src/python/gudhi/alpha_complex.pyx
index 4ff37437..dab4b56f 100644
--- a/src/python/gudhi/alpha_complex.pyx
+++ b/src/python/gudhi/alpha_complex.pyx
@@ -26,11 +26,11 @@ __license__ = "GPL v3"
cdef extern from "Alpha_complex_interface.h" namespace "Gudhi":
cdef cppclass Alpha_complex_interface "Gudhi::alpha_complex::Alpha_complex_interface":
- Alpha_complex_interface(vector[vector[double]] points)
+ Alpha_complex_interface(vector[vector[double]] points) except +
# bool from_file is a workaround for cython to find the correct signature
- Alpha_complex_interface(string off_file, bool from_file)
- vector[double] get_point(int vertex)
- void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square)
+ Alpha_complex_interface(string off_file, bool from_file) except +
+ vector[double] get_point(int vertex) except +
+ void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, double max_alpha_square) except +
# AlphaComplex python interface
cdef class AlphaComplex:
@@ -71,7 +71,7 @@ cdef class AlphaComplex:
def __cinit__(self, points = None, off_file = ''):
if off_file:
if os.path.isfile(off_file):
- self.thisptr = new Alpha_complex_interface(str.encode(off_file), True)
+ self.thisptr = new Alpha_complex_interface(off_file.encode('utf-8'), True)
else:
print("file " + off_file + " not found.")
else:
@@ -98,8 +98,7 @@ cdef class AlphaComplex:
:rtype: list of float
:returns: the point.
"""
- cdef vector[double] point = self.thisptr.get_point(vertex)
- return point
+ return self.thisptr.get_point(vertex)
def create_simplex_tree(self, max_alpha_square = float('inf')):
"""