-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add a User Guide #245
Add a User Guide #245
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
abf9b37
to
202e0db
Compare
You can see the results here: https://llucax.github.io/frequenz-channels-python/v1.0-pre/user-guide/quick-start/ A few comments about stuff I found or thought about while doing this guide:
|
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed upto the select
commit. Will continue with the rest soon.
src/frequenz/channels/_select.py
Outdated
receivers as they receive new values. | ||
|
||
It yields a [`Selected`][frequenz.channels.Selected] object that will tell you the | ||
source of the received message. To make sure the received value is *casted* to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoting from: https://www.wordreference.com/englishusage/cast
The verb cast has several other meanings. Note that for all its meanings its past tense and past participle is cast, not ‘casted’.
source of the received message. To make sure the received value is *casted* to the | |
source of the received message. To make sure the received value is *cast* to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this one is pending.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks for checking, it must have been lost in some rebase because I'm sure I updated the file at some point. Updated now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a small comment from my side. Besides, I mostly agree with Sahas' additions (indicated by 'thumbs up').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments, but keeping the timer
commit for the afternoon, because it is a bit big. So the last 3 commits are pending.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished reviewing. This is amazing work, Luca! very comprehensive.
src/frequenz/channels/timer.py
Outdated
1 microsecond). | ||
|
||
This is to avoid floating point errors when performing calculations with time, | ||
which can lead to very hard to reproduce, and debug, issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which can lead to very hard to reproduce, and debug, issues. | |
which can lead to issues that are very hard to reproduce and debug. |
Updated with all the suggestions, except for the ones I left follow-up comments. |
Please mark the conversation that you happy with the resolution as resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks luca, all looks good to me. I will approve once you fixup.
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
This section includes basic installation instructions and some quick examples so users can have a very broad overview of what the library is about. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The quick start section is reused from the README. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
We want users to be able to quickly get a feeling of the library, so it is better to also have this quick start guide in the home of the documentation. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Now the installation instruction have their own page in the user guide. We also add a tip linking to the full installation instructions in the README. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
These are mainly pages including docstrings from the source code. There are only a few pages with content of their own, and they are usually just glue to put some related docstrings together. There is one notable exception, the general channel concepts, that don't have a better home. The content of the docstring will be improved later to make the user guide more cohesive. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add a "Characteristics" summary with the most important properties of this channel type, a diagram to show how messages are routed from multiple senders to multiple receivers, explain a bit more about what happens when buffers are full and improve and add a new example. The formatting is done having in mind this documentation is now included in the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add a "Characteristics" summary with the most important properties of this channel type, a diagram to show how messages are routed from multiple senders to multiple receivers, explain a bit more about what happens when buffers are full and improve and add a new example. The formatting is done having in mind this documentation is now included in the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Explain the base exceptions and the basics of error handling, including how to get the cause of an exception. This module is not publicly available, so users won't be able to access the information in IDEs for example, but it will be rendered as part of the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Explain how to use the `merge()` function and the `Merger` type on a higher level than the function documentation. This module is not publicly available, so users won't be able to access the information in IDEs for example, but it will be rendered as part of the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Give a general introduction to receivers, explaining how one usually create them, how to map values, how to handle receiving errors and how to use the low-level methods. This module is not publicly available, so users won't be able to access the information in IDEs for example, but it will be rendered as part of the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Explaining how `select()` should be used, including how to stop the iteration, how to handle errors and mentioning the exhaustiveness check. This module is not publicly available, so users won't be able to access the information in IDEs for example, but it will be rendered as part of the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Give a short introduction about how `Sender`s are created and used, including how to handle errors. This module is not publicly available, so users won't be able to access the information in IDEs for example, but it will be rendered as part of the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add a summary of the contents of the module in the module documentation and improve the `Event` class documentation and example. The formatting is done having in mind this documentation is now included in the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add a summary of the contents of the module in the module documentation and improve the `EventType` enum and `FileWatcher` class documentation and example. The formatting is done having in mind this documentation is now included in the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add a quick start guide with a couple of examples in the module documentation, as well as a general explanation about missing ticks. Improve documentation of the `MissedTickPolicy` class to explain how to create custom policies, including an example. Also improve the documentation of each missed tick policy provided by the module. Improve the `Timer` class documentation to focus on how to use timers more generally, referring to the `timeout()` and `periodic()` constructors for more information, and improve both constructors documentation to explain what they are useful for and include examples. The formatting is done having in mind this documentation is now included in the User Guide. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Admonitions are not properly rendered by GitHub, so they don't look great there, but they should be readable. Without leaving an empty line they are rendered as a single paragraph, which is very messy. Since the extra indentation is interpreted as a code block, we also need to treat examples differently, as otherwise the markdown is rendered verbatim, missing syntax highlighting and other features. To overcome this issue we use simple headings for examples in the README and then include them in the documentation as admnonitions. Becuase of this we need to have more fine-grained include blocks in the README, which is also not great, but it's better than the alternative. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Fixup done, enabling auto-merge. |
This PR introduces a new
User Guide
top level section in the documentation explaining how to use the library in a more practical and cohesive way than just reading through the API documentation.The bulk of the documentation is still hosted in the code itself, as docstrings, so users can still access most of user guide content directly from their IDE.
It also improves the README and the docs home page, adding a quick start section to both.
Fixes #177.