summaryrefslogtreecommitdiff
path: root/src/python/gudhi/simplex_tree.pyx
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-28 11:05:39 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-28 11:05:39 +0100
commitef2c5b53e88321f07ad93496f00dde16dc20f018 (patch)
tree0a7c4d1d7f69a691259e98ceed1439421fb14f3e /src/python/gudhi/simplex_tree.pyx
parent0b77fdd5d9bd057103cb23020089a6628c1f14e6 (diff)
Code review: rename get_simplex_filtration with get_simplex_and_filtration. Remove exception raise. Fix failed tests. Reword documentation
Diffstat (limited to 'src/python/gudhi/simplex_tree.pyx')
-rw-r--r--src/python/gudhi/simplex_tree.pyx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx
index 478139de..22978b6e 100644
--- a/src/python/gudhi/simplex_tree.pyx
+++ b/src/python/gudhi/simplex_tree.pyx
@@ -209,20 +209,18 @@ cdef class SimplexTree:
<double>filtration)
def get_filtration(self):
- """This function returns a list of all simplices with their given
+ """This function returns a generator with simplices and their given
filtration values.
:returns: The simplices sorted by increasing filtration values.
- :rtype: list of tuples(simplex, filtration)
+ :rtype: generator with tuples(simplex, filtration)
"""
cdef vector[Simplex_tree_simplex_handle].const_iterator it = self.get_ptr().get_filtration_iterator_begin()
cdef vector[Simplex_tree_simplex_handle].const_iterator end = self.get_ptr().get_filtration_iterator_end()
- while True:
- yield(self.get_ptr().get_simplex_filtration(dereference(it)))
+ while it != end:
+ yield(self.get_ptr().get_simplex_and_filtration(dereference(it)))
preincrement(it)
- if it == end:
- raise StopIteration
def get_skeleton(self, dimension):
"""This function returns the (simplices of the) skeleton of a maximum