uwtools.api.execute
API support for interacting with external drivers.
- uwtools.api.execute.execute(module, classname, task=None, schema_file=None, config=None, cycle=None, leadtime=None, batch=False, dry_run=False, graph_file=None, key_path=None, stdin_ok=False)
Execute a driver task.
If
batchis specified and the driver is instructed to run, its runscript will be configured for and submitted to the batch system. Otherwise, the executable will be run directly on the current system.- Parameters:
module (Path | str) – Path to driver module or name of module on sys.path.
classname (str) – Name of driver class to instantiate.
task (str | None) – Name of driver task to execute. If omitted, a list of available tasks is displayed.
schema_file (str | None) – The JSON Schema file to use for validation.
config (Path | str | None) – Path to config file (read stdin if missing or None).
cycle (datetime | None) – The cycle.
leadtime (timedelta | None) – The leadtime.
batch (bool | None) – Submit run to the batch system?
dry_run (bool | None) – Do not run the executable, just report what would have been done.
graph_file (Path | str | None) – Write Graphviz DOT output here.
key_path (list[YAMLKey] | None) – Path of keys to config block to use.
stdin_ok (bool | None) – OK to read from stdin?
- Returns:
The task-graph Node yielded by the task, if it completes without raising an exception.
- Return type:
Node | None