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 #279

Merged
merged 20 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/frequenz/channels/_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, message: str):
"""Initialize this error.

Args:
message: An error message.
message: The error message.
"""
super().__init__(message)

Expand All @@ -94,8 +94,8 @@ def __init__(self, message: str, channel: Any):
"""Initialize this error.

Args:
message: An error message.
channel: A reference to the channel that encountered the error.
message: The error message.
channel: The channel where the error happened.
"""
super().__init__(message)
self.channel: Any = channel
Expand All @@ -109,6 +109,6 @@ def __init__(self, channel: Any):
"""Initialize this error.

Args:
channel: A reference to the channel that was closed.
channel: The channel that was closed.
"""
super().__init__(f"Channel {channel} was closed", channel)
6 changes: 3 additions & 3 deletions src/frequenz/channels/_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def __aiter__(self) -> Self:
"""Initialize the async iterator over received values.

Returns:
`self`, since no extra setup is needed for the iterator.
This receiver, as it is already an async iterator.
"""
return self

Expand Down Expand Up @@ -235,7 +235,7 @@ def map(self, call: Callable[[_T_co], _U_co]) -> Receiver[_U_co]:
original receiver and use that instead.

Args:
call: function to apply on incoming messages.
call: The function to apply on incoming messages.
llucax marked this conversation as resolved.
Show resolved Hide resolved

Returns:
A `Receiver` to read results of the given function from.
Expand All @@ -253,7 +253,7 @@ def __init__(self, message: str, receiver: Receiver[_T_co]):
"""Initialize this error.

Args:
message: An error message.
message: The error message.
receiver: The [Receiver][frequenz.channels.Receiver] where the
error happened.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/frequenz/channels/_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self, message: str, sender: Sender[_T_contra]):
"""Initialize this error.

Args:
message: An error message.
message: The error message.
sender: The [Sender][frequenz.channels.Sender] where the error
happened.
"""
Expand Down
4 changes: 2 additions & 2 deletions src/frequenz/channels/file_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def __init__(
"""Initialize this file watcher.

Args:
paths: Paths to watch for changes.
event_types: Types of events to watch for. Defaults to watch for
paths: The paths to watch for changes.
event_types: The types of events to watch for. Defaults to watch for
all event types.
"""
self.event_types: frozenset[EventType] = frozenset(event_types)
Expand Down