def test_srp_params():
    metric = 'not_defined'
    vrp = SparseRipsPersistence(metric=metric)

    with pytest.raises(ValueError):
        vrp.fit_transform(X)
def test_srp_transform(epsilon, point_clouds, expected):
    srp = SparseRipsPersistence(epsilon=epsilon)

    assert_almost_equal(np.sort(srp.fit_transform(point_clouds), axis=1),
                        np.sort(expected, axis=1))
Exemplo n.º 3
0
def test_srp_transform(X, metric, epsilon, diagrams):
    srp = SparseRipsPersistence(metric=metric, epsilon=epsilon)

    assert_almost_equal(np.sort(srp.fit_transform(X), axis=1),
                        np.sort(diagrams, axis=1))