diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2020-07-08 21:55:45 +0200 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2020-07-08 21:55:45 +0200 |
commit | 75c94c33897342392e88d18e7dc0c4dbd3cade8b (patch) | |
tree | 438945841fe9f23819cffb5f186d1b78b516abd3 | |
parent | b03844ff3276c54cff49cef898fadc2b33930184 (diff) |
Rename insert_array -> insert_edges_from_array
-rw-r--r-- | src/python/gudhi/simplex_tree.pyx | 4 | ||||
-rwxr-xr-x | src/python/test/test_simplex_tree.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx index 557a80a9..d2d3f459 100644 --- a/src/python/gudhi/simplex_tree.pyx +++ b/src/python/gudhi/simplex_tree.pyx @@ -195,7 +195,7 @@ cdef class SimplexTree: """ return self.get_ptr().insert(simplex, <double>filtration) - def insert_array(self, filtrations, double max_filtration=numpy.inf): + def insert_edges_from_array(self, filtrations, double max_filtration=numpy.inf): """Inserts edges in an empty complex. The vertices are numbered from 0 to n-1, and the filtration values are encoded in the array, with the diagonal representing the vertices. It is the caller's responsibility to ensure that this defines a filtration, which can be achieved with either:: @@ -214,7 +214,7 @@ cdef class SimplexTree: """ filtrations = numpy.asanyarray(filtrations, dtype=float) cdef double[:,:] F = filtrations - assert self.num_vertices() == 0, "insert_array requires an empty SimplexTree" + assert self.num_vertices() == 0, "insert_edges_from_array requires an empty SimplexTree" cdef int n = F.shape[0] assert n == F.shape[1] with nogil: diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index f75be58d..02ad63cc 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -342,8 +342,8 @@ def test_simplices_iterator(): print("filtration is: ", simplex[1]) assert st.filtration(simplex[0]) == simplex[1] -def test_insert_array(): +def test_insert_edges_from_array(): st = SimplexTree() a = np.array([[1, 4, 13, 6], [4, 3, 11, 5], [13, 11, 10, 12], [6, 5, 12, 2]]) - st.insert_array(a, max_filtration=5) + st.insert_edges_from_array(a, max_filtration=5) assert list(st.get_filtration()) == [([0], 1.0), ([3], 2.0), ([1], 3.0), ([0, 1], 4.0), ([1, 3], 5.0)] |