Ejemplo n.º 1
0
def test_two_dimensional_tensor(pts):
    """Verify that the oneDimensionalCover fails for an input
    with more than one dimension, and that the CubicalCover
    does not."""
    one_d = OneDimensionalCover()
    with pytest.raises(ValueError):
        one_d.fit(pts)
    cubical = CubicalCover()
    _ = cubical.fit(pts)
Ejemplo n.º 2
0
def test_cubical_fit_transform_consistent_with_1D(
        filter_values, kind, n_intervals, overlap_fraction
        ):
    """Check that CubicalCover gives the same results as OneDimensionalCover,
    on one-d data """
    one_d = OneDimensionalCover(kind, n_intervals, overlap_fraction)
    cubical = CubicalCover(kind, n_intervals, overlap_fraction)
    x_one_d = one_d.fit(filter_values).transform(filter_values)
    x_cubical = cubical.fit(filter_values).transform(filter_values)
    assert np.array_equal(x_one_d, x_cubical)