Add a function to instantiate a PipelineRun object from a run xml file.
authorDiane Trout <diane@caltech.edu>
Thu, 5 Feb 2009 20:04:25 +0000 (20:04 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 5 Feb 2009 20:04:25 +0000 (20:04 +0000)
gaworkflow/pipeline/runfolder.py

index 28d541386d14a9fd386364ab796b9f9186e012c7..57be2c89d38b4c8d7631fea2482eb15d562f6949 100644 (file)
@@ -136,6 +136,19 @@ class PipelineRun(object):
         tree = ElementTree.parse(filename).getroot()
         self.set_elements(tree)
 
+def load_pipeline_run_xml(pathname):
+    """
+    Load and instantiate a Pipeline run from a run xml file
+
+    :Parameters: 
+      - `pathname` : location of an run xml file
+
+    :Returns: initialized PipelineRun object
+    """
+    tree = ElementTree.parse(pathname).getroot()
+    run = PipelineRun(xml=tree)
+    return run
+
 def get_runs(runfolder):
     """
     Search through a run folder for all the various sub component runs