uwtools.api.ecflow

API access to uwtools ecFlow support.

uwtools.api.ecflow.realize(config, output_path=None, scripts_path=None, stdin_ok=False)

Realize the ecFlow workflow defined in the given YAML as a Suite Definition and ecf scripts.

If no input file is specified, stdin is read. A YAMLConfig object may also be provided as input. If no output file is specified, the Suite Definition is written to stdout. The ecf scripts are not produced if scripts_path is not provided.

Parameters:
  • config (_YAMLConfig | Path | str | None) – YAML input file or YAMLConfig object (None => read stdin).

  • output_path (Path | str | None) – Suite Definition output path (None => write to stdout).

  • scripts_path (Path | str | None) – ecf scripts top-level path (None => no scripts are generated).

  • stdin_ok (bool) – OK to read from stdin?

Raises:

UWConfigError if validation fails.

Returns:

True.

Return type:

bool

uwtools.api.ecflow.validate(config=None, stdin_ok=False)

Validate an ecFlow config against its schema.

Parameters:
  • config (_YAMLConfig | dict | Path | str | None) – YAML input file or YAMLConfig object to validate (None => read stdin).

  • stdin_ok (bool) – OK to read from stdin?

Returns:

True if the config conforms to the schema.

Raises:

UWConfigError if validation fails.

Return type:

bool