From af0d9d993a4c2dea02eb4b0ef3d6122fd21393a9 Mon Sep 17 00:00:00 2001 From: Dr Griffith Rees Date: Fri, 14 Jun 2024 11:47:14 +0100 Subject: [PATCH] fix(doc): fix `docstring_style: numpy` config in `mkdocs.yml` --- mkdocs.yml | 3 +-- reginald/utils.py | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index a73bed0..3a5c082 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -59,9 +59,8 @@ plugins: handlers: python: paths: [.] - selection: - docstring_style: numpy options: + docstring_style: numpy separate_signature: true show_signature_annotations: true annotations_path: brief diff --git a/reginald/utils.py b/reginald/utils.py index f0972f0..359a39b 100644 --- a/reginald/utils.py +++ b/reginald/utils.py @@ -74,6 +74,23 @@ def stream_progress_wrapper( ) -> Any: """Add a progress bar for iteration. + Parameters + ---------- + streamer + Funciton to add the `SpinnerColumn` while running + task_str + What to print whether `use_spinner` is `True` or not, + and if `use_spinner` is `True` is printed prior to + the `SpinningColumn`. + use_spinner + Whether to print the `SpinnerColumn` or not. + end + What to pass to the `end` parameter of `print` calls. + args + Any arguments to pass to `streamer` + kwargs + Any keyward arguments to pass to `streamer`. + Examples -------- >>> from time import sleep @@ -115,7 +132,21 @@ def stream_iter_progress_wrapper( Parameters ---------- streamer - Function that + `Iterable`, `Callable` or `chain` to add the `SpinnerColumn` + while iteraing over. A `Callabe` will be converted to a + `Generator`. + task_str + What to print whether `use_spinner` is `True` or not, + and if `use_spinner` is `True` is printed prior to + the `SpinningColumn`. + use_spinner + Whether to print the `SpinnerColumn` or not. + end + What to pass to the `end` parameter of `print` calls. + args + Any arguments to pass to `streamer` + kwargs + Any keyward arguments to pass to `streamer`. Examples --------