diff options
author | Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> | 2021-11-06 09:25:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-06 09:25:22 +0100 |
commit | cfb60a50a7c3aea08abc41118fbfdf31061a44a4 (patch) | |
tree | afa1ae04af05b901ab357ee573474ee982410345 /src/python/gudhi/cubical_complex.pyx | |
parent | 728acf3e9ecfba29fc9be7fba5fc88f0a7f49880 (diff) | |
parent | 37d7743a91f7fb970425a06798ac6cb61b0be109 (diff) |
Merge pull request #538 from VincentRouvreau/empty_diagram_management_for_representations
Empty diagram management for representations
Diffstat (limited to 'src/python/gudhi/cubical_complex.pyx')
-rw-r--r-- | src/python/gudhi/cubical_complex.pyx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx index 97c69a2d..8e244bb8 100644 --- a/src/python/gudhi/cubical_complex.pyx +++ b/src/python/gudhi/cubical_complex.pyx @@ -281,4 +281,8 @@ 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 len(piid) == 0: + return np.empty(shape = [0, 2]) + return piid |