...
Code Block |
---|
| from ecflow import *
with Defs() as defs:
with defs.add_suite("s1") as suite:
with suite.add_family("f1") as family:
for i in [ "a", "b", "c" ]:
family.add_task( "t" + i)
defs.save_as_defs("test.def") |
|
Code Block |
---|
| from ecflow import *
defs = Defs().add(
Suite("s1").add(
Family("f1").add(
[ Task("t{}".format(t))
for t in ("a", "b", "c")])))
defs.save_as_defs("test.def") |
|
Code Block |
---|
| from ecflow import *
defs = Defs()
defs += [ Suite("s1") ]
defs.s1 += [ Family("f1") ]
defs.s1.f1 += [ Task("t{}".format(t))
for t in ("a", "b", "c")]
defs.save_as_defs("test.def") |
|
The following example adds 5 suites, with 5 families with 5 tasks. However care needs to be take, to ensure that python is readable. It is recommended that you check your results
Code Block |
---|
from ecflow import *
defs = Defs().add(
[ Suite("s{}".format(i)).add(
[ Family("f{}".format(i)).add(
[ Task("t{}".format(i)) for i in range(1,6)] )
for i in range(1,6)] )
for i in range(1,6) ] )
assert(len(defs)==5, " expected 5 suites but found " + str(len(defs)))
for suite in defs:
assert(len(suite)==5, " expected 5 familes but found " + str(len(suite)))
for fam in suite:
assert(len(fam)==5, " expected 5 tasks but found " + str(len(fam))) |