ecFlow's documentation is now on readthedocs!

One possible solution:

import os
import ecflow 
   
defs = ecflow.Defs()
suite = defs.add_suite("back_archiving")
suite.add_repeat( ecflow.RepeatDay(1) )
suite.add_variable("ECF_HOME",    os.getenv("HOME") + "/course")
suite.add_variable("ECF_INCLUDE", os.getenv("HOME") + "/course")
suite.add_variable("ECF_FILES",   os.getenv("HOME") + "/course/back")
suite.add_variable("SLEEP", "2")
suite.add_limit("access", 2)
for kind in ( "analysis", "forecast", "climatology", "observations", "images" ):
    find_fam = suite.add_family(kind)
    find_fam.add_repeat( ecflow.RepeatDate("DATE", 19900101, 19950712) )
    find_fam.add_variable("KIND", kind)
    find_fam.add_task("get_old").add_inlimit("access")
    find_fam.add_task("convert").add_trigger("get_old == complete")
    find_fam.add_task("save_new").add_trigger("convert == complete")
    




1 Comment

  1. Alternative style

    import os
    from ecflow import *
    
    home = os.path.join(os.getenv("HOME"), "course")
    defs = Defs(
             Suite("back_archiving",
                RepeatDay(1),
                Edit(ECF_HOME=home,ECF_INCLUDE=home,ECF_FILES= home + "/back",SLEEP=2),
                Limit("access", 2),
                [ Family(kind,
                    RepeatDate( "DATE", 19900101, 19950712 ),
                    Edit(KIND=kind),
                    Task("get_old",  InLimit("access")),
                    Task("convert",  Trigger("get_old == complete")),
                    Task("save_new", Trigger("convert == complete")))
                  for kind in ( "analysis", "forecast", "climatology", "observations", "images" ) ] ))
    print(defs)