uwtools.api.ww3
API access to the uwtools ww3 driver.
- class uwtools.api.ww3.WaveWatchIII(cycle, config=None, key_path=None, schema_file=None, controller=None)
An assets driver for ww3.
- Parameters:
cycle (datetime) – The cycle.
config (dict | str | YAMLConfig | Path | None) – Path to config file (read stdin if missing or None).
key_path (list[YAMLKey] | None) – Keys of keys to driver config block.
schema_file (Path | None) – Path to schema file to use to validate an external driver.
controller (list[YAMLKey] | None) – Key(s) leading to block in config controlling run-time values.
- static create_user_updated_config(config_class, config_values, path, schema=None)
Create a config from a base file, user-provided values, or a combination of the two.
- property cycle
The cycle.
- namelist_file()
Render the namelist from the template file.
- namelist_schema(config_keys=None, schema_keys=None)
Return the (sub)schema for validating the driver’s namelist content.
- provisioned_rundir()
Run directory provisioned with all required content.
- restart_directory()
The restart directory.
- taskname(suffix=None)
Return a common tag for task-related log messages.
- validate()
Validate the UW driver config.
- uwtools.api.ww3.execute(task, cycle, config=None, batch=False, dry_run=False, graph_file=None, key_path=None, schema_file=None, stdin_ok=False)
Execute a task.
If
batchis specified, a runscript will be written and submitted to the batch system. Otherwise, the executable will be run directly on the current system.- Parameters:
task (str) – The task to execute.
config (Path | str | None) – Path to config file (read stdin if missing or None).
cycle (dt.datetime) – The cycle.
batch (bool) – Submit run to the batch system?
dry_run (bool) – 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.
schema_file (Path | str | None) – The JSON Schema file to use for validation.
stdin_ok (bool) – OK to read from stdin?
- Returns:
Trueif task completes without raising an exception.- Return type: