Exemple #1
0
def test_build_distributions_matrix_simple():
    distributions = kappa.build_distributions_matrix(
        2, 3, np.array([[0, 1], [1, 1], [0, 0]]))
    assert distributions[0, 0] == 2.0 / 3
    assert distributions[1, 0] == 1.0 / 3
    assert distributions[0, 1] == 1.0 / 3
    assert distributions[1, 1] == 2.0 / 3
def test_build_distributions_matrix_longer():
    distributions = kappa.build_distributions_matrix(3, 5, np.array([[0, 1], [2, 2], [1, 1], [0, 2], [1, 1]]))
    assert distributions[0, 0] == 2.0 / 5
    assert distributions[0, 1] == 0
    assert distributions[1, 0] == 2.0 / 5
    assert distributions[1, 1] == 3.0 / 5
    assert distributions[2, 0] == 1.0 / 5
    assert distributions[2, 1] == 2.0 / 5
Exemple #3
0
def test_build_distributions_matrix_longer():
    distributions = kappa.build_distributions_matrix(
        3, 5, np.array([[0, 1], [2, 2], [1, 1], [0, 2], [1, 1]]))
    assert distributions[0, 0] == 2.0 / 5
    assert distributions[0, 1] == 0
    assert distributions[1, 0] == 2.0 / 5
    assert distributions[1, 1] == 3.0 / 5
    assert distributions[2, 0] == 1.0 / 5
    assert distributions[2, 1] == 2.0 / 5
def test_build_distributions_matrix_simple():
    distributions = kappa.build_distributions_matrix(2, 3, np.array([[0, 1], [1, 1], [0, 0]]))
    assert distributions[0, 0] == 2.0 / 3
    assert distributions[1, 0] == 1.0 / 3
    assert distributions[0, 1] == 1.0 / 3
    assert distributions[1, 1] == 2.0 / 3