def test_partitioned_repertoire_with_tripartition(s):
    tripartition = Tripartition(Part((), (1, )), Part((0, ), ()),
                                Part((), (2, )))

    assert np.array_equal(
        s.partitioned_repertoire(Direction.CAUSE, tripartition),
        np.array([[[0.25, 0.25], [0.25, 0.25]]]))
Exemple #2
0
def test_wedge_partitions():
    mechanism, purview = (0, ), (1, 2)
    assert set(wedge_partitions(mechanism, purview)) == set([
        Tripartition(Part((), ()), Part((), (1, 2)), Part((0, ), ())),
    ])

    mechanism, purview = (3, 4), (5, 6)
    assert set(wedge_partitions(mechanism, purview)) == set([
        Tripartition(Part((), ()), Part((), (5, 6)), Part((3, 4), ())),
        Tripartition(Part((), ()), Part((3, ), ()), Part((4, ), (5, 6))),
        Tripartition(Part((), ()), Part((3, ), (5, )), Part((4, ), (6, ))),
        Tripartition(Part((), ()), Part((3, ), (5, 6)), Part((4, ), ())),
        Tripartition(Part((), ()), Part((3, ), (6, )), Part((4, ), (5, ))),
        Tripartition(Part((), (5, )), Part((3, ), ()), Part((4, ), (6, ))),
        Tripartition(Part((), (5, )), Part((3, ), (6, )), Part((4, ), ())),
        Tripartition(Part((), (6, )), Part((3, ), ()), Part((4, ), (5, ))),
        Tripartition(Part((), (6, )), Part((3, ), (5, )), Part((4, ), ())),
    ])