예제 #1
0
def test_omni_unconnected():
    np.random.seed(4)
    n = 100
    m = 50

    graphs = [er_nm(n, m) for _ in range(2)]
    omni = OmnibusEmbed()

    with pytest.warns(UserWarning):
        omni.fit(graphs)
예제 #2
0
def test_omni_matrix_invalid_inputs():
    with pytest.raises(ValueError):
        empty_list = []
        omni = OmnibusEmbed(n_components=2)
        omni.fit(empty_list)

    with pytest.raises(ValueError):
        wrong_shapes = [np.ones((10, 10)), np.ones((20, 20))]
        omni = OmnibusEmbed(n_components=2)
        omni.fit(wrong_shapes)

    with pytest.raises(TypeError):
        wrong_dtypes = [1, 2, 3]
        omni = OmnibusEmbed(n_components=2)
        omni.fit(wrong_dtypes)