Пример #1
0
def test_internal_degree():
    net = InteractingNetworks.SmallDirectedTestNetwork()

    res = net.internal_degree([0, 3, 5])
    exp = np.array([2, 1, 1])
    assert (res == exp).all()

    res = net.internal_degree([1, 2, 4])
    exp = np.array([2, 2, 2])
    assert (res == exp).all()
Пример #2
0
def test_internal_outdegree():
    net = InteractingNetworks.SmallDirectedTestNetwork()

    res = net.internal_outdegree([0, 1, 3])
    exp = np.array([2, 0, 1])
    assert (res == exp).all()
Пример #3
0
def test_cross_outdegree():
    net = InteractingNetworks.SmallDirectedTestNetwork()

    res = net.cross_outdegree([1, 2], [0, 3, 4])
    exp = np.array([1, 0])
    assert (res == exp).all()