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

Improve documentation #136

Merged
merged 5 commits into from
Jul 14, 2023
Merged

Improve documentation #136

merged 5 commits into from
Jul 14, 2023

Conversation

llucax
Copy link
Contributor

@llucax llucax commented Jul 13, 2023

  • Add missing enum members documentation
  • Make cross-linking more consistent
  • Improve Timer documentation

@llucax llucax requested a review from a team as a code owner July 13, 2023 10:50
@llucax llucax self-assigned this Jul 13, 2023
@github-actions github-actions bot added part:synchronization Affects the synchronization of multiple sources (`select`, `merge`) part:core Affects the core types (`Sender`, `Receiver`, exceptions, etc.) labels Jul 13, 2023
@llucax llucax modified the milestones: v0.18.0, v0.17.0 Jul 13, 2023
@llucax llucax added part:docs Affects the documentation type:enhancement New feature or enhancement visitble to users labels Jul 13, 2023
@llucax llucax enabled auto-merge July 13, 2023 10:51
Otherwise they are not rendered as part of the documentation at all.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add some more cross-linking and list all the available missed ticks
policies.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@github-actions github-actions bot removed the part:docs Affects the documentation label Jul 13, 2023
@@ -18,7 +18,7 @@


class Selected(Generic[_T]):
"""A result of a [`select`][frequenz.channels.util.select] iteration.
"""A result of a [`select()`][frequenz.channels.util.select] iteration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we always want to use () when referencing functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the rest of the file we always were referring to the select function as select(), so in this case I just wanted to have a consistent style.

@@ -270,36 +270,49 @@ def __repr__(self) -> str:
class Timer(Receiver[timedelta]):
"""A timer receiver that triggers every `interval` time.

The timer as microseconds resolution, so the `interval` must be at least
The timer as microseconds resolution, so the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as -> has?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


This drift will likely never be `0`, because if there is a task that is
running when it should trigger, the timer will be delayed. In this case the
drift will be positive. A negative drift should be technically impossible,
as the timer uses `asyncio`s loop monotonic clock.
as the timer uses [`asyncio`][asyncio]s loop monotonic clock.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to be using a mix of of () and [] here. Is [name][ref] different from (name)[ref]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[name](ref) is a regular, standard, markdown link, [name][ref] is a mkdocstrings extension to do code-crosslinking, so ref can only be a valid fully-qualified Python symbol.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When configuring external "object inventories", this references can even point to external python packages, in this case asyncio will link to Python's official docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, (name)[ref] is incorrect, so if you spotted one is a bug, but I'm assuming is just a typo in your GitHub comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of my forever confusions in markdown syntax 😅 I can never remember the right order

the `missed_tick_policy`. Missing ticks might or might not trigger
a message and the drift could be accumulated or not depending on the
chosen policy.
If the timer is delayed too much, then the timer will behave according to the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the timer is delayed too much, then the timer it will

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax requested a review from Marenz July 14, 2023 07:08
@llucax llucax added this pull request to the merge queue Jul 14, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit 9cd9516 Jul 14, 2023
8 checks passed
@llucax llucax deleted the improve-docs branch July 14, 2023 08:09
@llucax llucax modified the milestones: v1.0.0, v1.0.0-rc.1 Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:core Affects the core types (`Sender`, `Receiver`, exceptions, etc.) part:synchronization Affects the synchronization of multiple sources (`select`, `merge`) type:enhancement New feature or enhancement visitble to users
Projects
Development

Successfully merging this pull request may close these issues.

2 participants