Ejemplo n.º 1
0
fr_alg = sl.getLayoutAlgorithmOptions()


def test_fr_alg_options_defaults():

    assert fr_alg.k == 20
    assert fr_alg.gravity == 0
    assert fr_alg.baryx == 500
    assert fr_alg.baryy == 500
    assert fr_alg.autobary == 1
    assert fr_alg.padding == 20


sl2 = SBMLlayout(str(model_file))

sl2.setLayoutAlgorithm_k(15)
sl2.setLayoutAlgorithm_gravity(20)
sl2.setLayoutAlgorithm_baryx(100)
sl2.setLayoutAlgorithm_baryy(250) 
sl2.setLayoutAlgorithm_padding(40)

fr_alg_2 = sl2.getLayoutAlgorithmOptions()


def test_fr_alg_options_set_k():
    assert fr_alg_2.k == 15


def test_fr_alg_options_set_gravity():
    assert fr_alg_2.gravity == 20
Ejemplo n.º 2
0
sl = SBMLlayout(str(model_file))

sl.drawNetwork()

sl.showLayoutAlgorithmOptions()

fr_alg = sl.getLayoutAlgorithmOptions()

assert fr_alg.k == 20
assert fr_alg.gravity == 0
assert fr_alg.baryx == 500
assert fr_alg.baryy == 500
assert fr_alg.autobary == 1
assert fr_alg.padding == 20

sl.setLayoutAlgorithm_k(15)

fr_alg = sl.getLayoutAlgorithmOptions()

assert fr_alg.k == 15

sl.regenerateLayout()

sl.drawNetwork()

sl.setLayoutAlgorithm_k(30)

fr_alg = sl.getLayoutAlgorithmOptions()

assert fr_alg.k == 30