Beispiel #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))
Beispiel #2
0
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
Beispiel #3
0
def test_ces_labeled_mechanisms(s):
    c = models.CauseEffectStructure([concept(subsystem=s)], subsystem=s)
    assert c.labeled_mechanisms == (["A", "B"], )
Beispiel #4
0
def test_ces_repr_str(s):
    c = models.CauseEffectStructure([concept(subsystem=s)])
    repr(c)
    str(c)
Beispiel #5
0
def test_ces_is_still_a_tuple(s):
    c = models.CauseEffectStructure([concept(subsystem=s)], subsystem=s)
    assert len(c) == 1
Beispiel #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))
Beispiel #7
0
def test_ces_repr_str():
    c = models.CauseEffectStructure([concept()])
    repr(c)
    str(c)
Beispiel #8
0
def test_ces_repr():
    c = models.CauseEffectStructure()
    assert repr(c) == "CauseEffectStructure()"
Beispiel #9
0
def test_ces_is_still_a_tuple():
    c = models.CauseEffectStructure([concept()])
    assert len(c) == 1