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

Docstring cleanup #585

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions docs/sections/user_guide/cli/drivers/cdeps/help.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Optional arguments:
Positional arguments:
TASK
atm
Create data atmosphere configuration with all required content
The data atmosphere configuration with all required content
atm_nml
Create data atmosphere Fortran namelist file (datm_in)
The data atmosphere Fortran namelist file (datm_in)
atm_stream
Create data atmosphere stream config file (datm.streams)
The data atmosphere stream config file (datm.streams)
ocn
Create data ocean configuration with all required content
The data ocean configuration with all required content
ocn_nml
Create data ocean Fortran namelist file (docn_in)
The data ocean Fortran namelist file (docn_in)
ocn_stream
Create data ocean stream config file (docn.streams)
The data ocean stream config file (docn.streams)
validate
Validate the UW driver config
2 changes: 1 addition & 1 deletion docs/sections/user_guide/cli/drivers/cdeps/run-help.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ usage: uw cdeps atm --cycle CYCLE [-h] [--version] [--config-file PATH]
[--dry-run] [--graph-file PATH] [--key-path KEY[.KEY...]]
[--quiet] [--verbose]

Create data atmosphere configuration with all required content
The data atmosphere configuration with all required content

Required arguments:
--cycle CYCLE
Expand Down
8 changes: 4 additions & 4 deletions src/uwtools/api/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def execute(

def tasks(module: Union[Path, str], classname: str) -> dict[str, str]:
"""
Returns a mapping from driver task names to their one-line descriptions.
Return a mapping from driver task names to their one-line descriptions.

:param module: Name of driver module.
:param classname: Name of driver class to instantiate.
Expand All @@ -104,7 +104,7 @@ def _get_driver_class(
module: Union[Path, str], classname: str
) -> tuple[Optional[Type], Optional[Path]]:
"""
Returns the driver class.
Return the driver class.

:param module: Name of driver module to load.
:param classname: Name of driver class to instantiate.
Expand All @@ -124,7 +124,7 @@ def _get_driver_class(

def _get_driver_module_explicit(module: Path) -> Optional[ModuleType]:
"""
Returns the named module found via explicit lookup of given path.
Return the named module found via explicit lookup of given path.

:param module: Name of driver module to load.
"""
Expand All @@ -143,7 +143,7 @@ def _get_driver_module_explicit(module: Path) -> Optional[ModuleType]:

def _get_driver_module_implicit(module: str) -> Optional[ModuleType]:
"""
Returns the named module found via implicit (sys.path-based) lookup.
Return the named module found via implicit (sys.path-based) lookup.

:param module: Name of driver module to load.
"""
Expand Down
70 changes: 35 additions & 35 deletions src/uwtools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def main() -> None:

def _add_subparser_config(subparsers: Subparsers) -> ModeChecks:
"""
Subparser for mode: config
Add subparser for mode: config

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -116,7 +116,7 @@ def _add_subparser_config(subparsers: Subparsers) -> ModeChecks:

def _add_subparser_config_compare(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: config compare
Add subparser for mode: config compare

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand Down Expand Up @@ -146,7 +146,7 @@ def _add_subparser_config_compare(subparsers: Subparsers) -> ActionChecks:

def _add_subparser_config_realize(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: config realize
Add subparser for mode: config realize

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -172,7 +172,7 @@ def _add_subparser_config_realize(subparsers: Subparsers) -> ActionChecks:

def _add_subparser_config_validate(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: config validate
Add subparser for mode: config validate

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -186,7 +186,7 @@ def _add_subparser_config_validate(subparsers: Subparsers) -> ActionChecks:

def _dispatch_config(args: Args) -> bool:
"""
Dispatch logic for config mode.
Define dispatch logic for config mode.

:param args: Parsed command-line args.
"""
Expand All @@ -200,7 +200,7 @@ def _dispatch_config(args: Args) -> bool:

def _dispatch_config_compare(args: Args) -> bool:
"""
Dispatch logic for config compare action.
Define dispatch logic for config compare action.

:param args: Parsed command-line args.
"""
Expand All @@ -214,7 +214,7 @@ def _dispatch_config_compare(args: Args) -> bool:

def _dispatch_config_realize(args: Args) -> bool:
"""
Dispatch logic for config realize action.
Define dispatch logic for config realize action.

:param args: Parsed command-line args.
"""
Expand Down Expand Up @@ -242,7 +242,7 @@ def _dispatch_config_realize(args: Args) -> bool:

def _dispatch_config_validate(args: Args) -> bool:
"""
Dispatch logic for config validate action.
Define dispatch logic for config validate action.

:param args: Parsed command-line args.
"""
Expand All @@ -258,7 +258,7 @@ def _dispatch_config_validate(args: Args) -> bool:

def _add_subparser_execute(subparsers: Subparsers) -> ModeChecks:
"""
Subparser for mode: execute
Add subparser for mode: execute

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -285,7 +285,7 @@ def _add_subparser_execute(subparsers: Subparsers) -> ModeChecks:

def _dispatch_execute(args: Args) -> bool:
"""
Dispatch logic for execute mode.
Define dispatch logic for execute mode.

:param args: Parsed command-line args.
"""
Expand All @@ -310,7 +310,7 @@ def _dispatch_execute(args: Args) -> bool:

def _add_subparser_fs(subparsers: Subparsers) -> ModeChecks:
"""
Subparser for mode: fs
Add subparser for mode: fs

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -326,7 +326,7 @@ def _add_subparser_fs(subparsers: Subparsers) -> ModeChecks:

def _add_subparser_fs_common(parser: Parser) -> ActionChecks:
"""
Common subparser code for mode: fs {copy link makedirs}
Perform common subparser setup for mode: fs {copy link makedirs}

:param parser: The parser to configure.
"""
Expand All @@ -343,7 +343,7 @@ def _add_subparser_fs_common(parser: Parser) -> ActionChecks:

def _add_subparser_fs_copy(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: fs copy
Add subparser for mode: fs copy

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -353,7 +353,7 @@ def _add_subparser_fs_copy(subparsers: Subparsers) -> ActionChecks:

def _add_subparser_fs_link(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: fs link
Add subparser for mode: fs link

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -363,7 +363,7 @@ def _add_subparser_fs_link(subparsers: Subparsers) -> ActionChecks:

def _add_subparser_fs_makedirs(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: fs makedirs
Add subparser for mode: fs makedirs

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -373,7 +373,7 @@ def _add_subparser_fs_makedirs(subparsers: Subparsers) -> ActionChecks:

def _dispatch_fs(args: Args) -> bool:
"""
Dispatch logic for fs mode.
Define dispatch logic for fs mode.

:param args: Parsed command-line args.
"""
Expand All @@ -387,7 +387,7 @@ def _dispatch_fs(args: Args) -> bool:

def _dispatch_fs_copy(args: Args) -> bool:
"""
Dispatch logic for fs copy action.
Define dispatch logic for fs copy action.

:param args: Parsed command-line args.
"""
Expand All @@ -404,7 +404,7 @@ def _dispatch_fs_copy(args: Args) -> bool:

def _dispatch_fs_link(args: Args) -> bool:
"""
Dispatch logic for fs link action.
Define dispatch logic for fs link action.

:param args: Parsed command-line args.
"""
Expand All @@ -421,7 +421,7 @@ def _dispatch_fs_link(args: Args) -> bool:

def _dispatch_fs_makedirs(args: Args) -> bool:
"""
Dispatch logic for fs makedirs action.
Define dispatch logic for fs makedirs action.

:param args: Parsed command-line args.
"""
Expand All @@ -441,7 +441,7 @@ def _dispatch_fs_makedirs(args: Args) -> bool:

def _add_subparser_rocoto(subparsers: Subparsers) -> ModeChecks:
"""
Subparser for mode: rocoto
Add subparser for mode: rocoto

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -456,7 +456,7 @@ def _add_subparser_rocoto(subparsers: Subparsers) -> ModeChecks:

def _add_subparser_rocoto_realize(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: rocoto realize
Add subparser for mode: rocoto realize

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -470,7 +470,7 @@ def _add_subparser_rocoto_realize(subparsers: Subparsers) -> ActionChecks:

def _add_subparser_rocoto_validate(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: rocoto validate
Add subparser for mode: rocoto validate

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -483,7 +483,7 @@ def _add_subparser_rocoto_validate(subparsers: Subparsers) -> ActionChecks:

def _dispatch_rocoto(args: Args) -> bool:
"""
Dispatch logic for rocoto mode.
Define dispatch logic for rocoto mode.

:param args: Parsed command-line args.
"""
Expand All @@ -496,7 +496,7 @@ def _dispatch_rocoto(args: Args) -> bool:

def _dispatch_rocoto_realize(args: Args) -> bool:
"""
Dispatch logic for rocoto realize action. Validate input and output.
Define dispatch logic for rocoto realize action. Validate input and output.

:param args: Parsed command-line args.
"""
Expand All @@ -509,7 +509,7 @@ def _dispatch_rocoto_realize(args: Args) -> bool:

def _dispatch_rocoto_validate(args: Args) -> bool:
"""
Dispatch logic for rocoto validate action.
Define dispatch logic for rocoto validate action.

:param args: Parsed command-line args.
"""
Expand All @@ -521,7 +521,7 @@ def _dispatch_rocoto_validate(args: Args) -> bool:

def _add_subparser_template(subparsers: Subparsers) -> ModeChecks:
"""
Subparser for mode: template
Add subparser for mode: template

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -536,7 +536,7 @@ def _add_subparser_template(subparsers: Subparsers) -> ModeChecks:

def _add_subparser_template_translate(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: template translate
Add subparser for mode: template translate

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -550,7 +550,7 @@ def _add_subparser_template_translate(subparsers: Subparsers) -> ActionChecks:

def _add_subparser_template_render(subparsers: Subparsers) -> ActionChecks:
"""
Subparser for mode: template render
Add subparser for mode: template render

:param subparsers: Parent parser's subparsers, to add this subparser to.
"""
Expand All @@ -571,7 +571,7 @@ def _add_subparser_template_render(subparsers: Subparsers) -> ActionChecks:

def _dispatch_template(args: Args) -> bool:
"""
Dispatch logic for template mode.
Define dispatch logic for template mode.

:param args: Parsed command-line args.
"""
Expand All @@ -584,7 +584,7 @@ def _dispatch_template(args: Args) -> bool:

def _dispatch_template_render(args: Args) -> bool:
"""
Dispatch logic for template render action.
Define dispatch logic for template render action.

:param args: Parsed command-line args.
"""
Expand All @@ -611,7 +611,7 @@ def _dispatch_template_render(args: Args) -> bool:

def _dispatch_template_translate(args: Args) -> bool:
"""
Dispatch logic for template translate action.
Define dispatch logic for template translate action.

:param args: Parsed command-line args.
"""
Expand Down Expand Up @@ -968,7 +968,7 @@ def _add_subparser_for_driver(
with_leadtime: Optional[bool] = False,
) -> ModeChecks:
"""
Subparser for a standalone-driver mode.
Add subparser for a standalone-driver mode.

:param name: Name of the driver whose subparser to configure.
:param subparsers: Parent parser's subparsers, to add this subparser to.
Expand Down Expand Up @@ -996,7 +996,7 @@ def _add_subparser_for_driver_task(
with_leadtime: Optional[bool] = False,
) -> ActionChecks:
"""
Subparser for a driver action.
Add subparser for a driver action.

:param subparsers: Parent parser's subparsers, to add this subparser to.
:param task: The task to add a subparser for.
Expand Down Expand Up @@ -1101,7 +1101,7 @@ def _dict_from_key_eq_val_strings(config_items: list[str]) -> dict[str, str]:

def _dispatch_to_driver(name: str, args: Args) -> bool:
"""
Dispatch logic for a driver mode.
Define dispatch logic for a driver mode.

:param name: Name of the driver to dispatch to.
:param args: Parsed command-line args.
Expand All @@ -1123,7 +1123,7 @@ def _dispatch_to_driver(name: str, args: Args) -> bool:

def _formatter(prog: str) -> HelpFormatter:
"""
A standard formatter for help messages.
Return a standard formatter for help messages.
"""
# max_help_positions sets the maximum starting column for option help text.
return HelpFormatter(prog, max_help_position=6)
Expand Down
2 changes: 1 addition & 1 deletion src/uwtools/config/atparse_to_jinja2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def convert(
input_file: Optional[Path] = None, output_file: Optional[Path] = None, dry_run: bool = False
) -> None:
"""
Replaces atparse @[] tokens with Jinja2 {{}} equivalents.
Replace atparse @[] tokens with Jinja2 {{}} equivalents.

If no input file is given, stdin is used. If no output file is given, stdout is used. In dry-run
mode, output is written to stderr.
Expand Down
Loading
Loading