Skip to content

Commit d215c3e

Browse files
Fix typos in code documentation and tests
Signed-off-by: Daniel Zullo <[email protected]>
1 parent a97e9f7 commit d215c3e

File tree

15 files changed

+31
-31
lines changed

15 files changed

+31
-31
lines changed

src/frequenz/channels/_anycast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def new_receiver(self) -> Receiver[T]:
111111
class Sender(BaseSender[T]):
112112
"""A sender to send messages to an Anycast channel.
113113
114-
Should not be created directly, but through the `Anycast.ggetet_sender()`
114+
Should not be created directly, but through the `Anycast.new_sender()`
115115
method.
116116
"""
117117

@@ -211,7 +211,7 @@ def consume(self) -> T:
211211

212212
assert (
213213
self._next is not _Empty
214-
), "`consume()` must be preceeded by a call to `ready()`"
214+
), "`consume()` must be preceded by a call to `ready()`"
215215
# mypy doesn't understand that the assert above ensures that self._next is not
216216
# _Sentinel. So we have to use a type ignore here.
217217
next_val: T = self._next # type: ignore[assignment]

src/frequenz/channels/_bidirectional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async def send(self, msg: V) -> None:
5757
except SenderError as err:
5858
# If this comes from a channel error, then we inject another
5959
# ChannelError having the information about the Bidirectional
60-
# channel to hide (at least partially) the underlaying
60+
# channel to hide (at least partially) the underlying
6161
# Broadcast channels we use.
6262
if isinstance(err.__cause__, ChannelError):
6363
this_chan_error = ChannelError(
@@ -98,7 +98,7 @@ def consume(self) -> W:
9898
except ReceiverError as err:
9999
# If this comes from a channel error, then we inject another
100100
# ChannelError having the information about the Bidirectional
101-
# channel to hide (at least partially) the underlaying
101+
# channel to hide (at least partially) the underlying
102102
# Broadcast channels we use.
103103
if isinstance(err.__cause__, ChannelError):
104104
this_chan_error = ChannelError(

src/frequenz/channels/_broadcast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def consume(self) -> T:
311311
if not self._q and self._chan.closed:
312312
raise ReceiverStoppedError(self) from ChannelClosedError(self._chan)
313313

314-
assert self._q, "`consume()` must be preceeded by a call to `ready()`"
314+
assert self._q, "`consume()` must be preceded by a call to `ready()`"
315315
return self._q.popleft()
316316

317317
def into_peekable(self) -> Peekable[T]:

src/frequenz/channels/util/_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def exit_after_10_seconds() -> None:
4141
if selected_from(selected, other_receiver):
4242
print(selected.value)
4343
else:
44-
assert False, "Unknow receiver selected"
44+
assert False, "Unknown receiver selected"
4545
```
4646
"""
4747

src/frequenz/channels/util/_file_watcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def consume(self) -> Event:
129129
if not self._changes and self._awatch_stopped_exc is not None:
130130
raise ReceiverStoppedError(self) from self._awatch_stopped_exc
131131

132-
assert self._changes, "`consume()` must be preceeded by a call to `ready()`"
132+
assert self._changes, "`consume()` must be preceded by a call to `ready()`"
133133
# Tuple of (Change, path) returned by watchfiles
134134
change, path_str = self._changes.pop()
135135
return FileWatcher.Event(

src/frequenz/channels/util/_merge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,6 @@ def consume(self) -> T:
113113
if not self._results and not self._pending:
114114
raise ReceiverStoppedError(self)
115115

116-
assert self._results, "`consume()` must be preceeded by a call to `ready()`"
116+
assert self._results, "`consume()` must be preceded by a call to `ready()`"
117117

118118
return self._results.popleft()

src/frequenz/channels/util/_merge_named.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ def consume(self) -> tuple[str, T]:
9494
if not self._results and not self._pending:
9595
raise ReceiverStoppedError(self)
9696

97-
assert self._results, "`consume()` must be preceeded by a call to `ready()`"
97+
assert self._results, "`consume()` must be preceded by a call to `ready()`"
9898

9999
return self._results.popleft()

src/frequenz/channels/util/_select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class SelectErrorGroup(BaseExceptionGroup[BaseException], SelectError):
198198
"""An exception group for [`select()`][frequenz.channels.util.select] operation.
199199
200200
This exception group is raised when a `select()` loops fails while cleaning up
201-
runing tasts to check for ready receivers.
201+
running tests to check for ready receivers.
202202
"""
203203

204204

src/frequenz/channels/util/_timer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class TriggerAllMissed(MissedTickPolicy):
8181
Example:
8282
Assume a timer with interval 1 second, the tick `T0` happens exactly
8383
at time 0, the second tick, `T1`, happens at time 1.2 (0.2 seconds
84-
late), so it trigges immediately. The third tick, `T2`, happens at
84+
late), so it triggers immediately. The third tick, `T2`, happens at
8585
time 2.3 (0.3 seconds late), so it also triggers immediately. The
8686
fourth tick, `T3`, happens at time 4.3 (1.3 seconds late), so it also
8787
triggers immediately as well as the fifth tick, `T4`, which was also
@@ -120,15 +120,15 @@ def calculate_next_tick_time(
120120
class SkipMissedAndResync(MissedTickPolicy):
121121
"""A policy that drops all the missed ticks, triggers immediately and resyncs.
122122
123-
If ticks are missed, the timer will trigger immediately returing the drift
123+
If ticks are missed, the timer will trigger immediately returning the drift
124124
and it will schedule to trigger again on the next multiple of `interval`,
125125
effectively skipping any missed ticks, but resyncing with the original start
126126
time.
127127
128128
Example:
129129
Assume a timer with interval 1 second, the tick `T0` happens exactly
130130
at time 0, the second tick, `T1`, happens at time 1.2 (0.2 seconds
131-
late), so it trigges immediately. The third tick, `T2`, happens at
131+
late), so it triggers immediately. The third tick, `T2`, happens at
132132
time 2.3 (0.3 seconds late), so it also triggers immediately. The
133133
fourth tick, `T3`, happens at time 4.3 (1.3 seconds late), so it also
134134
triggers immediately but the fifth tick, `T4`, which was also
@@ -180,7 +180,7 @@ class SkipMissedAndDrift(MissedTickPolicy):
180180
Assume a timer with interval 1 second and `delay_tolerance=0.1`, the
181181
first tick, `T0`, happens exactly at time 0, the second tick, `T1`,
182182
happens at time 1.2 (0.2 seconds late), so the timer triggers
183-
immmediately but drifts a bit. The next tick, `T2.2`, happens at 2.3 seconds
183+
immediately but drifts a bit. The next tick, `T2.2`, happens at 2.3 seconds
184184
(0.1 seconds late), so it also triggers immediately but it doesn't
185185
drift because the delay is under the `delay_tolerance`. The next tick,
186186
`T3.2`, triggers at 4.3 seconds (1.1 seconds late), so it also triggers
@@ -200,7 +200,7 @@ def __init__(self, *, delay_tolerance: timedelta = timedelta(0)):
200200
"""
201201
Create an instance.
202202
203-
See the class documenation for more details.
203+
See the class documentation for more details.
204204
205205
Args:
206206
delay_tolerance: The maximum delay that is tolerated before

tests/test_anycast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def test_anycast() -> None:
2828
expected_sum = num_senders * num_receivers * (num_receivers + 1) / 2
2929

3030
# a list of `num_receivers` elements, where each element with get
31-
# incremented by values the corrosponding receiver receives. Once the run
31+
# incremented by values the corresponding receiver receives. Once the run
3232
# finishes, we will check if their sum equals `expected_sum`.
3333
recv_trackers = [0] * num_receivers
3434

@@ -46,7 +46,7 @@ async def update_tracker_on_receive(receiver_id: int, recv: Receiver[int]) -> No
4646
assert isinstance(err.__cause__, ChannelClosedError)
4747
return
4848
recv_trackers[receiver_id] += msg
49-
# without the sleep, decomissioning receivers temporarily, all
49+
# without the sleep, decommissioning receivers temporarily, all
5050
# messages go to the first receiver.
5151
await asyncio.sleep(0)
5252

0 commit comments

Comments
 (0)