def test_sia_disconnected_network(reducible): assert (compute.sia(reducible) == models.SystemIrreducibilityAnalysis(subsystem=reducible, cut_subsystem=reducible, phi=0.0, ces=[], partitioned_ces=[]))
def test_sia_empty_subsystem(s_empty): assert compute.sia(s_empty) == models.SystemIrreducibilityAnalysis( phi=0.0, ces=(), partitioned_ces=(), subsystem=s_empty, cut_subsystem=s_empty)
def test_sia_wrappers(reducible): assert (compute.sia(reducible) == models.SystemIrreducibilityAnalysis(subsystem=reducible, cut_subsystem=reducible, phi=0.0, ces=[], partitioned_ces=[])) assert compute.phi(reducible) == 0.0
def test_sia_empty_subsystem(s_empty, flushcache, restore_fs_cache): flushcache() assert (compute.sia(s_empty) == models.SystemIrreducibilityAnalysis( phi=0.0, ces=(), partitioned_ces=(), subsystem=s_empty, cut_subsystem=s_empty))
def sia(ces=(), partitioned_ces=(), subsystem=None, cut_subsystem=None, phi=1.0): """Build a ``SystemIrreducibilityAnalysis``.""" cut_subsystem = cut_subsystem or subsystem return models.SystemIrreducibilityAnalysis( ces=ces, partitioned_ces=partitioned_ces, subsystem=subsystem, cut_subsystem=cut_subsystem, phi=phi)