summaryrefslogtreecommitdiff
path: root/src/python/gudhi/cubical_complex.pyx
diff options
context:
space:
mode:
authorVincent Rouvreau <vincent.rouvreau@inria.fr>2021-10-18 17:01:02 +0200
committerVincent Rouvreau <vincent.rouvreau@inria.fr>2021-10-18 17:01:02 +0200
commitec06a9b9ae0a9ff1897249dcbc2b497764f54aaf (patch)
treeaa2cff976ab75ea3b1f1ef9f638f5199551cf32c /src/python/gudhi/cubical_complex.pyx
parent8adb46d8a54f1a0dd71ea686473cc4ca9f5d2f67 (diff)
First part of the fix
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