summaryrefslogtreecommitdiff
path: root/src/python/gudhi/alpha_complex.pyx
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2021-03-12 15:46:36 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2021-03-12 15:46:36 +0100
commita71694354af45e8edc2e2d2b4e14795bf9b5e5f1 (patch)
tree828037055878f60b5aa37468933bdd082af2dffa /src/python/gudhi/alpha_complex.pyx
parentc838e3ec441109cc02ea4612dd2189860662298f (diff)
review constructor and test with one point and without points
Diffstat (limited to 'src/python/gudhi/alpha_complex.pyx')
-rw-r--r--src/python/gudhi/alpha_complex.pyx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/python/gudhi/alpha_complex.pyx b/src/python/gudhi/alpha_complex.pyx
index ea128743..f5f0ca5b 100644
--- a/src/python/gudhi/alpha_complex.pyx
+++ b/src/python/gudhi/alpha_complex.pyx
@@ -71,20 +71,18 @@ cdef class AlphaComplex:
"""
# The real cython constructor
- def __cinit__(self, points = None, off_file = '', precision = 'safe'):
+ def __cinit__(self, points = [], off_file = '', precision = 'safe'):
assert precision in ['fast', 'safe', 'exact'], "Alpha complex precision can only be 'fast', 'safe' or 'exact'"
cdef bool fast = precision == 'fast'
cdef bool exact = precision == 'exact'
- cdef vector[vector[double]] pts
if off_file:
if os.path.isfile(off_file):
points = read_points_from_off_file(off_file = off_file)
else:
print("file " + off_file + " not found.")
- if points is None:
- # Empty Alpha construction
- points=[]
+ # need to copy the points to use them without the gil
+ cdef vector[vector[double]] pts
pts = points
with nogil:
self.this_ptr = new Alpha_complex_interface(pts, fast, exact)