コード例 #1
0
def test_ces_ordering(s):
    assert (models.CauseEffectStructure([concept(subsystem=s)], subsystem=s) ==
            models.CauseEffectStructure([concept(subsystem=s)], subsystem=s))

    assert (models.CauseEffectStructure([concept(phi=1, subsystem=s)],
                                        subsystem=s) >
            models.CauseEffectStructure([concept(phi=0, subsystem=s)],
                                        subsystem=s))
コード例 #2
0
ファイル: test_models.py プロジェクト: wesmith/pyphi
def test_ces_are_always_normalized(s):
    c1 = concept(mechanism=(0, ), subsystem=s)
    c2 = concept(mechanism=(1, ), subsystem=s)
    c3 = concept(mechanism=(0, 2), subsystem=s)
    c4 = concept(mechanism=(0, 1, 2), subsystem=s)
    assert (c1, c2, c3, c4) == models.CauseEffectStructure(
        (c3, c4, c2, c1)).concepts
コード例 #3
0
ファイル: test_models.py プロジェクト: wesmith/pyphi
def test_ces_labeled_mechanisms(s):
    c = models.CauseEffectStructure([concept(subsystem=s)], subsystem=s)
    assert c.labeled_mechanisms == (["A", "B"], )
コード例 #4
0
ファイル: test_models.py プロジェクト: wesmith/pyphi
def test_ces_repr_str(s):
    c = models.CauseEffectStructure([concept(subsystem=s)])
    repr(c)
    str(c)
コード例 #5
0
ファイル: test_models.py プロジェクト: wesmith/pyphi
def test_ces_is_still_a_tuple(s):
    c = models.CauseEffectStructure([concept(subsystem=s)], subsystem=s)
    assert len(c) == 1
コード例 #6
0
def test_ces_are_always_normalized():
    c1 = models.Concept(mechanism=(1, ))
    c2 = models.Concept(mechanism=(2, ))
    c3 = models.Concept(mechanism=(1, 3))
    c4 = models.Concept(mechanism=(1, 2, 3))
    assert (c1, c2, c3, c4) == models.CauseEffectStructure((c3, c4, c2, c1))
コード例 #7
0
def test_ces_repr_str():
    c = models.CauseEffectStructure([concept()])
    repr(c)
    str(c)
コード例 #8
0
def test_ces_repr():
    c = models.CauseEffectStructure()
    assert repr(c) == "CauseEffectStructure()"
コード例 #9
0
def test_ces_is_still_a_tuple():
    c = models.CauseEffectStructure([concept()])
    assert len(c) == 1