From 7023b1defaf02d6385a4f78c04daf60ccd3203ad Mon Sep 17 00:00:00 2001 From: kreczko Date: Tue, 10 Oct 2023 12:29:55 +0100 Subject: [PATCH] docs: add docstrings to classes and functions --- docs/conf.py | 2 +- src/fasthep_flow/cli.py | 4 ++++ src/fasthep_flow/config.py | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 4839cf0..f98a5e2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,7 +37,7 @@ "source_directory": "docs/", "light_logo": "fast-flow-black.png", "dark_logo": "fast-flow-white.png", - "announcement": "THIS IS WORK IN PROGRESS!", + "announcement": 'Interested in contributing? Head to the GitHub repository and open a pull request!', } html_css_files = ["css/custom.css"] diff --git a/src/fasthep_flow/cli.py b/src/fasthep_flow/cli.py index cd2308b..6fe960f 100644 --- a/src/fasthep_flow/cli.py +++ b/src/fasthep_flow/cli.py @@ -11,6 +11,7 @@ @app.command() def lint(config: Path) -> None: + """Lint a config file. Throws errors if the config is invalid.""" typer.echo(f"Linting {config}") load_config(config) typer.echo("Looks good to me!") @@ -18,13 +19,16 @@ def lint(config: Path) -> None: @app.command() def print_defaults() -> None: + """Print the default config.""" typer.echo("Printing defaults...") @app.command() def execute(config: Path) -> None: + """Execute a config file.""" typer.echo(f"Executing {config}...") def main() -> None: + """Entrypoint for the CLI.""" app() diff --git a/src/fasthep_flow/config.py b/src/fasthep_flow/config.py index 150e838..e9079f4 100644 --- a/src/fasthep_flow/config.py +++ b/src/fasthep_flow/config.py @@ -9,6 +9,8 @@ @dataclass class StageConfig: + """A stage in the workflow.""" + name: str type: str needs: list[str] @@ -18,10 +20,13 @@ class StageConfig: @dataclass class FlowConfig: + """The workflow.""" + stages: list[StageConfig] def load_config(config_file: pathlib.Path) -> Any: + """Load a config file and return the structured config.""" schema = OmegaConf.structured(FlowConfig) conf = OmegaConf.load(config_file) return OmegaConf.merge(schema, conf)