class_docstr: Controls the setup and execution of a pipeline of processes.
class_docstr_tok: ["Controls","the","setup","and","execution","of","a","pipeline","of","processes","."]
docstr: Execute the workflow
  
  Parameters
  ----------
  
  plugin: plugin name or object
      Plugin to use for execution. You can create your own plugins for
      execution.
  plugin_args : dictionary containing arguments to be sent to plugin
      constructor. see individual plugin doc strings for details.
docstr_tok: ["Execute","the","workflow","Parameters","--","--","--","--","--","plugin",":","plugin","name","or","object","Plugin","to","use","for","execution",".","You","can","create","your","own","plugins","for","execution",".","plugin_args",":","dictionary","containing","arguments","to","be","sent","to","plugin","constructor",".","see","individual","plugin","doc","strings","for","details","."]
code: def run(self, plugin=None, plugin_args=None, updatehash=False):
      """Execute the workflow
  
      Parameters
      ----------
  
      plugin: plugin name or object
          Plugin to use for execution. You can create your own plugins for
          execution.
      plugin_args : dictionary containing arguments to be sent to plugin
          constructor. see individual plugin doc strings for details.
      """
      if plugin is None:
          plugin = config.get("execution", "plugin")
      if not isinstance(plugin, (str, bytes)):
          runner = plugin
          plugin = runner.__class__.__name__[: -len("Plugin")]
          plugin_args = runner.plugin_args
      else:
          name = ".".join(__name__.split(".")[:-2] + ["plugins"])
          try:
              __import__(name)
          except ImportError:
              msg = "Could not import plugin module: %s" % name
              logger.error(msg)
              raise ImportError(msg)
          else:
              plugin_mod = getattr(
                  sys.modules[name], "%sPlugin" % plugin
              )
              runner = plugin_mod(plugin_args=plugin_args)
      flatgraph = self._create_flat_graph()
      self.config = merge_dict(deepcopy(config._sections), self.config)
      logger.info(
          "Workflow %s settings: %s",
          self.name,
          str(sorted(self.config)),
      )
      self._set_needed_outputs(flatgraph)
      execgraph = generate_expanded_graph(deepcopy(flatgraph))
      for index, node in enumerate(execgraph.nodes()):
          node.config = merge_dict(deepcopy(self.config), node.config)
          node.base_dir = self.base_dir
          node.index = index
          if isinstance(node, MapNode):
              node.use_plugin = (plugin, plugin_args)
      self._configure_exec_nodes(execgraph)
      if str2bool(self.config["execution"]["create_report"]):
          self._write_report_info(self.base_dir, self.name, execgraph)
      runner.run(execgraph, updatehash=updatehash, config=self.config)
      datestr = datetime.utcnow().strftime("%Y%m%dT%H%M%S")
      if str2bool(self.config["execution"]["write_provenance"]):
          prov_base = op.join(
              self.base_dir, "workflow_provenance_%s" % datestr
          )
          logger.info("Provenance file prefix: %s" % prov_base)
          write_workflow_prov(execgraph, prov_base, format="all")
  
      if config.resource_monitor:
          base_dir = self.base_dir or os.getcwd()
          write_workflow_resources(
              execgraph,
              filename=op.join(
                  base_dir, self.name, "resource_monitor.json"
              ),
          )
      return execgraph
  
imports: import os
  import os.path
  import sys
  from datetime import datetime
  from copy import deepcopy
  import pickle
  import shutil
  import numpy
  from ...None import config, logging
  from ...utils.misc import str2bool
  from ...utils.functions import getsource, create_function_from_source
  from ...interfaces.base import traits, TraitedSpec, TraitDictObject, TraitListObject
  from ...utils.filemanip import save_json
  from .utils import generate_expanded_graph, export_graph, write_workflow_prov, write_workflow_resources, format_dot, topological_sort, get_print_name, merge_dict, format_node
  from .base import EngineBase
  from .nodes import MapNode
label_desc: Use image node_id 14 for calling the Workflow obj's underlying member method code with example usage: obj.run(plugin, plugin_args, updatehash) and returns: execgraph