diff options
author | Gard Spreemann <gspr@nonempty.org> | 2020-08-11 13:57:10 +0200 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2020-08-11 13:57:10 +0200 |
commit | 1c4694087c9cc2ea155ba99cd3484f788ad4daad (patch) | |
tree | 24d3b0e0451decf442e5c92f4c5d473ccfc60b76 /src/python/test/test_cubical_complex.py | |
parent | fe7ba81633feafa9232546be4fef18cf37766b1f (diff) | |
parent | 1c05c20d7cf92c96b5036620cc892cb956c96785 (diff) |
Merge branch 'dfsg/latest' into debian/sid
Diffstat (limited to 'src/python/test/test_cubical_complex.py')
-rwxr-xr-x | src/python/test/test_cubical_complex.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/python/test/test_cubical_complex.py b/src/python/test/test_cubical_complex.py index 5c59db8f..d0e4e9e8 100755 --- a/src/python/test/test_cubical_complex.py +++ b/src/python/test/test_cubical_complex.py @@ -157,3 +157,20 @@ def test_cubical_generators(): 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])) + +def test_cubical_cofaces_of_persistence_pairs_when_pd_has_no_paired_birth_and_death(): + cubCpx = CubicalComplex(dimensions=[1,2], top_dimensional_cells=[0.0, 1.0]) + Diag = cubCpx.persistence(homology_coeff_field=2, min_persistence=0) + pairs = cubCpx.cofaces_of_persistence_pairs() + assert pairs[0] == [] + assert np.array_equal(pairs[1][0], np.array([0])) + +def test_periodic_cofaces_of_persistence_pairs_when_pd_has_no_paired_birth_and_death(): + perCubCpx = PeriodicCubicalComplex(dimensions=[1,2], top_dimensional_cells=[0.0, 1.0], + periodic_dimensions=[True, True]) + Diag = perCubCpx.persistence(homology_coeff_field=2, min_persistence=0) + pairs = perCubCpx.cofaces_of_persistence_pairs() + assert pairs[0] == [] + assert np.array_equal(pairs[1][0], np.array([0])) + assert np.array_equal(pairs[1][1], np.array([0, 1])) + assert np.array_equal(pairs[1][2], np.array([1])) |