-
Couldn't load subscription status.
- Fork 4
Enhance readme, add links, reformat #100
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
Conversation
Signed-off-by: Mathias L. Baumann <[email protected]>
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 have only a suggestion to check for. LGTM otherwise
README.md
Outdated
| ```python | ||
| from frequenz.client.dispatch import Client | ||
|
|
||
| # Initialize the client |
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'd suggest to wrap all the code within an async function. I know this will make the example much more verbose but otherwise the user might try to instantiate the client outside the asynchronous event loop.
For instance:
import asyncio
from frequenz.client.dispatch import Client
async def list_dispatches() -> None:
# Initialize the client
client = Client(key="your_api_key", server_url="grpc://fz-0004.frequenz.io")
# List all dispatches for a specific microgrid
async for page in client.list(microgrid_id=1):
for dispatch in page:
print(dispatch)
asyncio.run(list_dispatches())Signed-off-by: Mathias L. Baumann <[email protected]>
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.
Part of this is automatically generated by the repo config template, it would be good to update the template to put everything that is common to all repos there, to avoid every project diverging into completely different README structure and information.
|
@Marenz ☝️ |
No description provided.