Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UW-501 / UW-502 FV3 graph-based driver implementation #408

Merged
merged 147 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
e3d59ee
Add iotaa dependency
maddenp-noaa Jan 30, 2024
085b76a
Remove ??? methods
maddenp-noaa Jan 30, 2024
c3fcedc
WIP
maddenp-noaa Jan 31, 2024
5139935
Add dag.py
maddenp-noaa Jan 31, 2024
9230d7d
WIP on schema
maddenp-noaa Jan 31, 2024
d0fd916
Fix 'platform' schema
maddenp-noaa Jan 31, 2024
1955dd6
Fix 'preprocessing' schema
maddenp-noaa Jan 31, 2024
788cafc
Fix 'user' schema
maddenp-noaa Jan 31, 2024
3725633
WIP
maddenp-noaa Jan 31, 2024
ec1b705
WIP on schema
maddenp-noaa Jan 31, 2024
eb35246
Merge branch 'main' into UW-449
maddenp-noaa Jan 31, 2024
5fafa4d
Move validator() to test support
maddenp-noaa Jan 31, 2024
9d557b5
WIP on schema tests
maddenp-noaa Jan 31, 2024
bdbec5b
lfs -> lsf
maddenp-noaa Feb 1, 2024
f06cf8b
WIP
maddenp-noaa Feb 1, 2024
5d14181
WIP
maddenp-noaa Feb 1, 2024
57757de
WIP
maddenp-noaa Feb 1, 2024
6ccb584
WIP
maddenp-noaa Feb 1, 2024
309f4ff
WIP
maddenp-noaa Feb 1, 2024
c7c076a
WIP
maddenp-noaa Feb 1, 2024
f375db0
Docstring stubs
maddenp-noaa Feb 1, 2024
2869bfc
Fix batch-submit command
maddenp-noaa Feb 1, 2024
44089ff
Abort if driver config fails validation
maddenp-noaa Feb 1, 2024
ff40a8c
Add jobinfo to FV3Forecast.jsonschema
maddenp-noaa Feb 1, 2024
3eaafc9
Capture stderr from job submit cmd
maddenp-noaa Feb 1, 2024
135bd89
Move cycle param to FV3Forecast constructor
maddenp-noaa Feb 1, 2024
a8db65d
is_file, not is_dir
maddenp-noaa Feb 1, 2024
9fee5fd
WIP
maddenp-noaa Feb 1, 2024
c4e926b
Tests pass
maddenp-noaa Feb 2, 2024
6243f4d
Use iotaa 0.5.0
maddenp-noaa Feb 2, 2024
78baf4a
Add tasknames()
maddenp-noaa Feb 2, 2024
db6a8fb
Wire up tasknames to CLI
maddenp-noaa Feb 2, 2024
995ceb4
WIP
maddenp-noaa Feb 2, 2024
6b91df1
Add --task to uw forecast run
maddenp-noaa Feb 2, 2024
e123850
WIP
maddenp-noaa Feb 2, 2024
3e1e75f
Formatting
maddenp-noaa Feb 2, 2024
0824759
Delinting
maddenp-noaa Feb 2, 2024
d1ef020
Tests pass
maddenp-noaa Feb 2, 2024
546d1ee
CLI fixes
maddenp-noaa Feb 2, 2024
2fb029a
WIP
maddenp-noaa Feb 2, 2024
beba92b
WIP
maddenp-noaa Feb 2, 2024
fce80f4
WIP
maddenp-noaa Feb 2, 2024
565b2fc
Show default task in CLI
maddenp-noaa Feb 3, 2024
337e6d1
Work on provisioned_run_directory
maddenp-noaa Feb 3, 2024
8fcd1cf
Fix
maddenp-noaa Feb 3, 2024
7eaa028
WIP
maddenp-noaa Feb 3, 2024
9ecb899
WIP
maddenp-noaa Feb 3, 2024
4cb1837
Renames
maddenp-noaa Feb 5, 2024
b3cefde
WIP
maddenp-noaa Feb 5, 2024
fef3ad5
Delinting
maddenp-noaa Feb 5, 2024
63a7afa
Tests pass
maddenp-noaa Feb 5, 2024
06e9bec
WIP
maddenp-noaa Feb 5, 2024
fcd9556
WIP
maddenp-noaa Feb 5, 2024
0cac1db
Use only first line of task docstring
maddenp-noaa Feb 5, 2024
90ced63
Merge branch 'main' into UW-449
maddenp-noaa Feb 7, 2024
a25bf45
Changes to uwtools.drivers.fv3 from main
maddenp-noaa Feb 7, 2024
86f0484
Merge fv3 schemas
maddenp-noaa Feb 7, 2024
77e707e
Fix tests
maddenp-noaa Feb 7, 2024
6ac936b
forecast -> fv3 in yaml
maddenp-noaa Feb 7, 2024
257cb3d
Fix make clean-devenv target
maddenp-noaa Feb 8, 2024
8128e85
Use iotaa 0.6.*
maddenp-noaa Feb 8, 2024
8021cc4
Make run_directory() -> _run_directory() private task
maddenp-noaa Feb 8, 2024
b0e6ae4
Remove refs() call on @tasks function
maddenp-noaa Feb 8, 2024
8307079
Delinting
maddenp-noaa Feb 8, 2024
20f9663
Make batch/local run tasks private
maddenp-noaa Feb 8, 2024
dec5742
Private run_cmd() -> _run_cmd()
maddenp-noaa Feb 8, 2024
7ba6443
WIP
maddenp-noaa Feb 8, 2024
c0738a0
Simplify get_scheduler()
maddenp-noaa Feb 8, 2024
948625b
Work on execution block
maddenp-noaa Feb 8, 2024
545f0e6
Work on execution block
maddenp-noaa Feb 8, 2024
37d5650
Work on execution block
maddenp-noaa Feb 8, 2024
dc9424b
Work on execution block
maddenp-noaa Feb 8, 2024
5726215
Work on execution block
maddenp-noaa Feb 8, 2024
2827d7f
Add diag_table task
maddenp-noaa Feb 8, 2024
6f1d4b1
Add namelist_file task
maddenp-noaa Feb 8, 2024
e365117
Tidy up unit tests
maddenp-noaa Feb 8, 2024
716ff66
WIP
maddenp-noaa Feb 8, 2024
dbf32c1
WIP
maddenp-noaa Feb 8, 2024
e700fca
Refactoring
maddenp-noaa Feb 8, 2024
167c7df
WIP
maddenp-noaa Feb 9, 2024
2bcb6ad
WIP
maddenp-noaa Feb 9, 2024
80be089
Add boundary_files task
maddenp-noaa Feb 9, 2024
01795cb
WIP
maddenp-noaa Feb 9, 2024
b951064
Simplify
maddenp-noaa Feb 9, 2024
a5dc8f8
Clean up docstrings
maddenp-noaa Feb 9, 2024
20c17c2
Add restart_directory task
maddenp-noaa Feb 9, 2024
8a8ac1a
WIP
maddenp-noaa Feb 9, 2024
508f1f4
Work on runscript
maddenp-noaa Feb 9, 2024
a0dd02d
Work on scheduler support
maddenp-noaa Feb 9, 2024
e957b8f
Work on scheduler support
maddenp-noaa Feb 9, 2024
4718b0f
Simplify
maddenp-noaa Feb 9, 2024
2eeb53e
Reorder
maddenp-noaa Feb 9, 2024
faa9a77
Work on scheduler support
maddenp-noaa Feb 9, 2024
cef5e69
Work on scheduler support
maddenp-noaa Feb 9, 2024
fcad7c1
Work on scheduler support
maddenp-noaa Feb 9, 2024
7ba4b67
Fix runscript newlines
maddenp-noaa Feb 9, 2024
257532c
Add docstrings
maddenp-noaa Feb 9, 2024
15206b2
WIP
maddenp-noaa Feb 9, 2024
3b38de7
drivercfg -> driver_config
maddenp-noaa Feb 9, 2024
eda8c98
validate_yaml() -> validate_yaml_file()
maddenp-noaa Feb 9, 2024
c9f6355
Undo validate_yaml() -> validate_yaml_file()
maddenp-noaa Feb 9, 2024
12bf56e
WIP
maddenp-noaa Feb 9, 2024
9a626f1
WIP
maddenp-noaa Feb 9, 2024
ebc0063
Restore some tests
maddenp-noaa Feb 9, 2024
9025156
Mutual account/scheduler requirement
maddenp-noaa Feb 9, 2024
b6fae8b
Factor out platform schema
maddenp-noaa Feb 9, 2024
500ceda
Validate both fv3 and platform schemas
maddenp-noaa Feb 9, 2024
cd2de21
Move lateral_boundary_conditions into fv3 block
maddenp-noaa Feb 9, 2024
1d639e2
WIP
maddenp-noaa Feb 9, 2024
4c37ba0
Formatting
maddenp-noaa Feb 9, 2024
c326b4a
Add files_to_copy, files_to_link support
maddenp-noaa Feb 9, 2024
0deb87c
WIP
maddenp-noaa Feb 9, 2024
a5ca2b5
Use keyword arguments
maddenp-noaa Feb 10, 2024
fdda27c
Runscript improvements
maddenp-noaa Feb 10, 2024
51e76f7
Sort directives in scheduler module
maddenp-noaa Feb 10, 2024
902be81
Add envcmds
maddenp-noaa Feb 10, 2024
28221d8
Add export before env vars
maddenp-noaa Feb 10, 2024
14e046b
Use = in slurm directives
maddenp-noaa Feb 10, 2024
b7bb894
Flexible batchargs in fv3.jsonschema
maddenp-noaa Feb 10, 2024
93434a7
Make queue optional
maddenp-noaa Feb 10, 2024
7f20039
Improve test of tagged scalars
maddenp-noaa Feb 10, 2024
dd4796c
WIP
maddenp-noaa Feb 10, 2024
bb04d1c
Renaming
maddenp-noaa Feb 10, 2024
29b2a75
Renaming
maddenp-noaa Feb 10, 2024
478f7a8
Support unmanaged scheduler directives
maddenp-noaa Feb 10, 2024
da2598c
Use copy() not copyfile() to preserve permissions
maddenp-noaa Feb 10, 2024
9791441
Schema-validation log message
maddenp-noaa Feb 10, 2024
1e17749
Move mpicmd to fv3.execution
maddenp-noaa Feb 10, 2024
0d1a4c4
Remove unused _stage_files()
maddenp-noaa Feb 11, 2024
c12f427
Reorder
maddenp-noaa Feb 11, 2024
b336d77
Tidy up
maddenp-noaa Feb 11, 2024
281ac1e
Revert doc change
maddenp-noaa Feb 11, 2024
f153e7c
Automated doc updates
maddenp-noaa Feb 11, 2024
50fb327
Sphinx mock iotaa
maddenp-noaa Feb 11, 2024
e9d6368
Fix unit tests
maddenp-noaa Feb 11, 2024
3acdf7c
Fixes, permit Jinja expressions in keys, first-class cycle support
maddenp-noaa Feb 12, 2024
927a94a
Parametrize & combine tests
maddenp-noaa Feb 12, 2024
003e5b8
Update docs
maddenp-noaa Feb 12, 2024
657b4f9
Renaming
maddenp-noaa Feb 12, 2024
a5ee690
Fix uw_yaml toc
maddenp-noaa Feb 12, 2024
a03888b
Correct docstring
maddenp-noaa Feb 12, 2024
8eb7019
Remove some pylint suppressors
maddenp-noaa Feb 13, 2024
8a7c40b
Fix CLI doc line wrapping
maddenp-noaa Feb 13, 2024
68dc9c1
Fix typos
maddenp-noaa Feb 13, 2024
1efe13a
Fix typo & use more descriptive variable name
maddenp-noaa Feb 13, 2024
c2474fd
Use iotaa v0.7.1
maddenp-noaa Feb 14, 2024
a94d414
Merge branch 'main' into UW-449
maddenp-noaa Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGETS = clean-devenv devshell docs env format lint meta package test typec

export RECIPE_DIR := $(shell cd ./recipe && pwd)

clean = $(shell $(CONDA_EXE) env remove -n DEV-$(call val,name))
clean = $(info $(shell $(CONDA_EXE) env remove -n DEV-$(call val,name)))
maddenp-noaa marked this conversation as resolved.
Show resolved Hide resolved
spec = $(call val,name)$(2)$(call val,version)$(2)$(call val,$(1))
val = $(shell jq -r .$(1) $(METAJSON))

Expand Down
5 changes: 0 additions & 5 deletions docs/sections/user_guide/api/forecast.rst

This file was deleted.

5 changes: 5 additions & 0 deletions docs/sections/user_guide/api/fv3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
``uwtools.api.fv3``
========================

.. automodule:: uwtools.api.fv3
:members:
2 changes: 1 addition & 1 deletion docs/sections/user_guide/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ API

.. toctree::
config
forecast
fv3
logging
rocoto
template
1 change: 1 addition & 0 deletions recipe/channels
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
conda-forge
maddenp
maddenp-noaa marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions recipe/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"coverage =7.3.*",
"docformatter =1.7.*",
"f90nml =1.4.*",
"iotaa =0.6.*",
"isort =5.13.*",
"jinja2 =3.1.*",
"jq =1.7.*",
Expand All @@ -23,6 +24,7 @@
],
"run": [
"f90nml =1.4.*",
"iotaa =0.6.*",
"jinja2 =3.1.*",
"jsonschema =4.20.*",
"lxml =4.9.*",
Expand Down
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ requirements:
- pip
run:
- f90nml 1.4.*
- iotaa 0.6.*
- jinja2 3.1.*
- jsonschema 4.20.*
- lxml 4.9.*
Expand Down
41 changes: 0 additions & 41 deletions src/uwtools/api/forecast.py

This file was deleted.

41 changes: 41 additions & 0 deletions src/uwtools/api/fv3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import datetime as dt
from typing import Dict

import iotaa

from uwtools.drivers.fv3 import FV3
from uwtools.types import DefinitePath


def execute(
task: str,
config_file: DefinitePath,
cycle: dt.datetime,
batch: bool = False,
dry_run: bool = False,
) -> bool:
"""
Execute an FV3 task.

If ``batch`` is specified, a runscript will be written and submitted to the batch system.
Otherwise, the forecast will be run directly on the current system without a runscript.

:param task: The task to execute
:param config_file: Path to UW YAML config file
:param cycle: The cycle to run
:param batch: Submit run to the batch system
:param dry_run: Do not run forecast, just report what would have been done
:return: True if task completes without raising an exception
"""
obj = FV3(config_file=config_file, cycle=cycle, batch=batch, dry_run=dry_run)
getattr(obj, task)()
return True


def tasks() -> Dict[str, str]:
"""
Returns a mapping from task names to their one-line descriptions.
"""
return {
task: getattr(FV3, task).__doc__.strip().split("\n")[0] for task in iotaa.tasknames(FV3)
}
maddenp-noaa marked this conversation as resolved.
Show resolved Hide resolved
97 changes: 50 additions & 47 deletions src/uwtools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
from typing import Any, Callable, Dict, List, Tuple

import uwtools.api.config
import uwtools.api.forecast
import uwtools.api.fv3
maddenp-noaa marked this conversation as resolved.
Show resolved Hide resolved
import uwtools.api.rocoto
import uwtools.api.template
import uwtools.config.jinja2
import uwtools.rocoto
from uwtools.drivers.forecast import CLASSES as FORECAST_CLASSES
from uwtools.logging import log, setup_logging
from uwtools.utils.file import FORMAT, get_file_format

Expand Down Expand Up @@ -50,7 +49,7 @@ def main() -> None:
log.debug("Command: %s %s", Path(sys.argv[0]).name, " ".join(sys.argv[1:]))
modes = {
STR.config: _dispatch_config,
STR.forecast: _dispatch_forecast,
STR.fv3: _dispatch_fv3,
STR.rocoto: _dispatch_rocoto,
STR.template: _dispatch_template,
}
Expand All @@ -72,7 +71,7 @@ def _add_subparser_config(subparsers: Subparsers) -> ModeChecks:
"""
parser = _add_subparser(subparsers, STR.config, "Handle configs")
_basic_setup(parser)
subparsers = _add_subparsers(parser, STR.action)
subparsers = _add_subparsers(parser, STR.action, STR.action.upper())
return {
STR.compare: _add_subparser_config_compare(subparsers),
STR.realize: _add_subparser_config_realize(subparsers),
Expand Down Expand Up @@ -199,61 +198,54 @@ def _dispatch_config_validate(args: Args) -> bool:
return uwtools.api.config.validate(schema_file=args[STR.schemafile], config=args[STR.infile])


# Mode forecast
# Mode fv3


def _add_subparser_forecast(subparsers: Subparsers) -> ModeChecks:
def _add_subparser_fv3(subparsers: Subparsers) -> ModeChecks:
"""
Subparser for mode: forecast
Subparser for mode: fv3

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
parser = _add_subparser(subparsers, STR.forecast, "Configure and run forecasts")
parser = _add_subparser(subparsers, STR.fv3, "Execute FV3 tasks")
_basic_setup(parser)
subparsers = _add_subparsers(parser, STR.action)
subparsers = _add_subparsers(parser, STR.action, STR.task.upper())
return {
STR.run: _add_subparser_forecast_run(subparsers),
task: _add_subparser_fv3_task(subparsers, task, helpmsg)
for task, helpmsg in uwtools.api.fv3.tasks().items()
}


def _add_subparser_forecast_run(subparsers: Subparsers) -> ActionChecks:
def _add_subparser_fv3_task(subparsers: Subparsers, task: str, helpmsg: str) -> ActionChecks:
"""
Subparser for mode: forecast run
Subparser for mode: fv3 <task>

:param subparsers: Parent parser's subparsers, to add this subparser to.
:param task: The task to add a subparser for.
:param helpmsg: Help message for task.
"""
parser = _add_subparser(subparsers, STR.run, "Run a forecast")
parser = _add_subparser(subparsers, task, helpmsg.rstrip("."))
required = parser.add_argument_group(TITLE_REQ_ARG)
_add_arg_config_file(required)
_add_arg_cycle(required)
_add_arg_model(required, choices=list(FORECAST_CLASSES.keys()))
optional = _basic_setup(parser)
_add_arg_batch_script(optional)
_add_arg_batch(optional)
_add_arg_dry_run(optional)
checks = _add_args_verbosity(optional)
return checks


def _dispatch_forecast(args: Args) -> bool:
def _dispatch_fv3(args: Args) -> bool:
"""
Dispatch logic for forecast mode.
Dispatch logic for fv3 mode.

:param args: Parsed command-line args.
"""
return {STR.run: _dispatch_forecast_run}[args[STR.action]](args)


def _dispatch_forecast_run(args: Args) -> bool:
"""
Dispatch logic for forecast run action.

:param args: Parsed command-line args.
"""
return uwtools.api.forecast.run(
model=args[STR.model],
cycle=args[STR.cycle],
return uwtools.api.fv3.execute(
task=args[STR.action],
config_file=args[STR.cfgfile],
batch_script=args[STR.batch_script],
cycle=args[STR.cycle],
batch=args[STR.batch],
dry_run=args[STR.dryrun],
)

Expand All @@ -269,7 +261,7 @@ def _add_subparser_rocoto(subparsers: Subparsers) -> ModeChecks:
"""
parser = _add_subparser(subparsers, STR.rocoto, "Realize and validate Rocoto XML Documents")
_basic_setup(parser)
subparsers = _add_subparsers(parser, STR.action)
subparsers = _add_subparsers(parser, STR.action, STR.action.upper())
return {
STR.realize: _add_subparser_rocoto_realize(subparsers),
STR.validate: _add_subparser_rocoto_validate(subparsers),
Expand Down Expand Up @@ -346,7 +338,7 @@ def _add_subparser_template(subparsers: Subparsers) -> ModeChecks:
"""
parser = _add_subparser(subparsers, STR.template, "Handle templates")
_basic_setup(parser)
subparsers = _add_subparsers(parser, STR.action)
subparsers = _add_subparsers(parser, STR.action, STR.action.upper())
return {
STR.render: _add_subparser_template_render(subparsers),
STR.translate: _add_subparser_template_translate(subparsers),
Expand Down Expand Up @@ -435,14 +427,11 @@ def _dispatch_template_translate(args: Args) -> bool:
# pylint: disable=missing-function-docstring


def _add_arg_batch_script(group: Group, required: bool = False) -> None:
def _add_arg_batch(group: Group) -> None:
group.add_argument(
_switch(STR.batch_script),
help="Path to output batch file (defaults to stdout)",
metavar="PATH",
required=required,
default=None,
type=str,
_switch(STR.batch),
action="store_true",
help="Submit run to batch scheduler",
)


Expand All @@ -468,7 +457,7 @@ def _add_arg_cycle(group: Group) -> None:

def _add_arg_debug(group: Group) -> None:
group.add_argument(
"--debug",
_switch(STR.debug),
action="store_true",
help="""
Print all log messages, plus any unhandled exception's stack trace (implies --verbose)
Expand Down Expand Up @@ -595,6 +584,16 @@ def _add_arg_supplemental_files(group: Group) -> None:
)


def _add_arg_task(group: Group, default: str) -> None:
group.add_argument(
_switch(STR.task),
help="Task to execute (default: %s)" % default,
metavar="NAME",
type=str,
default=default,
)


def _add_arg_values_file(group: Group, required: bool = False) -> None:
group.add_argument(
_switch(STR.valsfile),
Expand Down Expand Up @@ -676,15 +675,17 @@ def _add_subparser(subparsers: Subparsers, name: str, helpmsg: str) -> Parser:
return parser


def _add_subparsers(parser: Parser, dest: str) -> Subparsers:
def _add_subparsers(parser: Parser, dest: str, metavar: str) -> Subparsers:
"""
Add subparsers to a parser.

:parm parser: The parser to add subparsers to.
:param parser: The parser to add subparsers to.
:param dest: Name of parser attribute to store subparser under.
:param metavar: Name for hierarchy of subparsers as shown by --help.
:return: The new subparsers object.
"""
return parser.add_subparsers(
dest=dest, metavar="MODE", required=True, title="Positional arguments"
dest=dest, metavar=metavar, required=True, title="Positional arguments"
)


Expand Down Expand Up @@ -756,10 +757,10 @@ def _parse_args(raw_args: List[str]) -> Tuple[Args, Checks]:
description="Unified Workflow Tools", add_help=False, formatter_class=_formatter
)
_basic_setup(parser)
subparsers = _add_subparsers(parser, STR.mode)
subparsers = _add_subparsers(parser, STR.mode, STR.mode.upper())
checks = {
STR.config: _add_subparser_config(subparsers),
STR.forecast: _add_subparser_forecast(subparsers),
STR.fv3: _add_subparser_fv3(subparsers),
STR.rocoto: _add_subparser_rocoto(subparsers),
STR.template: _add_subparser_template(subparsers),
}
Expand All @@ -783,7 +784,7 @@ class STR:
"""

action: str = "action"
batch_script: str = "batch_script"
batch: str = "batch"
cfgfile: str = "config_file"
compare: str = "compare"
config: str = "config"
Expand All @@ -794,7 +795,7 @@ class STR:
file1path: str = "file_1_path"
file2fmt: str = "file_2_format"
file2path: str = "file_2_path"
forecast: str = "forecast"
fv3: str = "fv3"
help: str = "help"
infile: str = "input_file"
infmt: str = "input_format"
Expand All @@ -810,6 +811,8 @@ class STR:
run: str = "run"
schemafile: str = "schema_file"
suppfiles: str = "supplemental_files"
task: str = "task"
tasks: str = "tasks"
template: str = "template"
translate: str = "translate"
validate: str = "validate"
Expand Down
6 changes: 1 addition & 5 deletions src/uwtools/config/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ def validate_yaml(
for error in errors:
for line in str(error).split("\n"):
log.error(line)
# It's pointless to evaluate an invalid config, so return now if that's the case.
if errors:
return False
# If no issues were detected, report success.
return True
return not bool(errors)


# Private functions
Expand Down
Loading
Loading