Skip to content

Commit

Permalink
Harmonize docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 3, 2024
1 parent 73de3ce commit 498663c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ You will find the built documentation in `docs/_build/html`.
"""
Do something.
Parameters:
x: A very important parameter.
Args:
x: A very important parameter.
Returns:
The result of doing something.
The result of doing something.
"""
```

Expand Down
19 changes: 10 additions & 9 deletions src/stamina/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,29 +325,30 @@ def retry(
All float-based time parameters are in seconds.
Parameters:
on: An Exception or a tuple of Exceptions on which the decorated
Args:
on:
An Exception or a tuple of Exceptions on which the decorated
callable will be retried. There is no default -- you *must* pass
this explicitly.
attempts: Maximum total number of attempts. Can be combined with
*timeout*.
attempts:
Maximum total number of attempts. Can be combined with *timeout*.
timeout: Maximum total time for all retries. Can be combined with
timeout:
Maximum total time for all retries. Can be combined with
*attempts*.
wait_initial: Minimum backoff before the *first* retry.
wait_max: Maximum backoff time between retries at any time.
wait_jitter: Maximum *jitter* that is added to retry back-off delays
(the actual jitter added is a random number between 0 and
*wait_jitter*)
wait_jitter:
Maximum *jitter* that is added to retry back-off delays (the actual
jitter added is a random number between 0 and *wait_jitter*)
wait_exp_base: The exponential base used to compute the retry backoff.
.. versionchanged:: 23.1.0
All time-related parameters can now be specified as a
:class:`datetime.timedelta`.
Expand Down
13 changes: 7 additions & 6 deletions src/stamina/instrumentation/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ class RetryDetails:
kwargs: Keyword arguments that were passed to the callable.
retry_num: Number of the retry attempt. Starts at 1 after the first
failure.
retry_num:
Number of the retry attempt. Starts at 1 after the first failure.
wait_for: Time in seconds that *stamina* will wait before the next
attempt.
wait_for:
Time in seconds that *stamina* will wait before the next attempt.
waited_so_far: Time in seconds that *stamina* has waited so far for the
current callable.
waited_so_far:
Time in seconds that *stamina* has waited so far for the current
callable.
caused_by: Exception that caused the retry attempt.
Expand Down
6 changes: 3 additions & 3 deletions src/stamina/instrumentation/_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def set_on_retry_hooks(
Set hooks that are called after a retry has been scheduled.
Args:
hooks: Hooks to call after a retry has been scheduled. Passing
None resets to default. To deactivate instrumentation, pass an
empty iterable.
hooks:
Hooks to call after a retry has been scheduled. Passing None resets
to default. To deactivate instrumentation, pass an empty iterable.
.. versionadded:: 23.2.0
"""
Expand Down

0 comments on commit 498663c

Please sign in to comment.