ecFlow's documentation is now on readthedocs!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

from ecflow import Defs,Suite,Variable,Edit

defs = Defs(Suite("s1",HELLO="world",FRED="bloggs",BILL=1,NAME="value",NAME2="value2"))
defs.s1.add_variable('NAME4',4)
defs.s1 += Edit(NAME3="value3")

The following examples show alternative styles that produce the same definition:

defs = Defs().add(
        Suite("s1").add(
          Edit(HELLO="world", FRED="bloggs",BILL=1,
               NAME="value", NAME2="value2",
               NAME3="value3",NAME4=4)))
 defs = Defs() + Suite("s1")
 defs.s1 += { "HELLO":"world", "NAME":"value",
              "NAME2":"value2","NAME3":"value3", 
              "NAME4":4,"BILL":1, "FRED":"bloggs"}  
 defs = Defs() + Suite("s1")
 defs.s1 += [ Edit(HELLO="world"),
              Edit({ "NAME":"value","NAME2":"value2", 
                     "NAME3":"value3", "NAME4":4 }, 
                     BILL=1),
              Edit(FRED="bloggs")]

Note: that although we are using class Edit as a short cut, the objects that are added are still of type Variable.

  • No labels