diff options
author | Vincent Rouvreau <vincent.rouvreau@inria.fr> | 2021-10-18 17:01:02 +0200 |
---|---|---|
committer | Vincent Rouvreau <vincent.rouvreau@inria.fr> | 2021-10-18 17:01:02 +0200 |
commit | ec06a9b9ae0a9ff1897249dcbc2b497764f54aaf (patch) | |
tree | aa2cff976ab75ea3b1f1ef9f638f5199551cf32c /src/python/gudhi/cubical_complex.pyx | |
parent | 8adb46d8a54f1a0dd71ea686473cc4ca9f5d2f67 (diff) |
First part of the fix
Diffstat (limited to 'src/python/gudhi/cubical_complex.pyx')
-rw-r--r-- | src/python/gudhi/cubical_complex.pyx | 7 |
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 |