diff options
author | Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> | 2020-05-15 14:33:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 14:33:14 +0200 |
commit | 9fb4015f9ccd394146bc436d7011d7855d919837 (patch) | |
tree | bca7f533a3d9ca7bcdd4a5a5557e284f8bdd8116 /src/python/test | |
parent | 1efd71c502bacce375e1950e10a8112208acd0cf (diff) | |
parent | b0ae08e93fdba8a1faec56c2230b6f542653c49e (diff) |
Merge pull request #204 from MathieuCarriere/generators
Generators
Diffstat (limited to 'src/python/test')
-rwxr-xr-x | src/python/test/test_cubical_complex.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/python/test/test_cubical_complex.py b/src/python/test/test_cubical_complex.py index fce4875c..5c59db8f 100755 --- a/src/python/test/test_cubical_complex.py +++ b/src/python/test/test_cubical_complex.py @@ -147,3 +147,13 @@ def test_connected_sublevel_sets(): periodic_dimensions = periodic_dimensions) assert cub.persistence() == [(0, (2.0, float("inf")))] assert cub.betti_numbers() == [1, 0, 0] + +def test_cubical_generators(): + cub = CubicalComplex(top_dimensional_cells = [[0, 0, 0], [0, 1, 0], [0, 0, 0]]) + cub.persistence() + g = cub.cofaces_of_persistence_pairs() + assert len(g[0]) == 2 + assert len(g[1]) == 1 + assert np.array_equal(g[0][0], np.empty(shape=[0,2])) + assert np.array_equal(g[0][1], np.array([[7, 4]])) + assert np.array_equal(g[1][0], np.array([8])) |