summaryrefslogtreecommitdiff
path: root/src/python/gudhi/cubical_complex.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/gudhi/cubical_complex.pyx')
-rw-r--r--src/python/gudhi/cubical_complex.pyx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx
index 97c69a2d..04569bd8 100644
--- a/src/python/gudhi/cubical_complex.pyx
+++ b/src/python/gudhi/cubical_complex.pyx
@@ -281,4 +281,9 @@ cdef class CubicalComplex:
launched first.
"""
assert self.pcohptr != NULL, "compute_persistence() must be called before persistence_intervals_in_dimension()"
- return np.array(self.pcohptr.intervals_in_dimension(dimension))
+ piid = np.array(self.pcohptr.intervals_in_dimension(dimension))
+ # Workaround https://github.com/GUDHI/gudhi-devel/issues/507
+ if piid.shape[0] == 0:
+ return np.empty(shape = [0, 2])
+ else:
+ return piid