Skip to content

Commit

Permalink
Fix typos and whitespace in worker.py (#6326)
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait authored May 13, 2022
1 parent 4b81f06 commit b8b45c6
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class Worker(ServerNode):
$ dask-worker --help
The rest of this docstring is about the internal state the the worker uses
The rest of this docstring is about the internal state that the worker uses
to manage and track internal computations.
**State**
Expand Down Expand Up @@ -291,7 +291,7 @@ class Worker(ServerNode):
**Volatile State**
These attributes track the progress of tasks that this worker is trying to
complete. In the descriptions below a ``key`` is the name of a task that
complete. In the descriptions below a ``key`` is the name of a task that
we want to compute and ``dep`` is the name of a piece of dependent data
that we want to collect from others.
Expand Down Expand Up @@ -361,7 +361,7 @@ class Worker(ServerNode):
memory_target_fraction: float or False
Fraction of memory to try to stay beneath
(default: read from config key distributed.worker.memory.target)
memory_spill_fraction: float or false
memory_spill_fraction: float or False
Fraction of memory at which we start spilling to disk
(default: read from config key distributed.worker.memory.spill)
memory_pause_fraction: float or False
Expand Down Expand Up @@ -1501,7 +1501,7 @@ async def close(
for c in Worker._initialized_clients:
# Regardless of what the client was initialized with
# we'll require the result as a future. This is
# necessary since the heursitics of asynchronous are not
# necessary since the heuristics of asynchronous are not
# reliable and we might deadlock here
c._asynchronous = True
if c.asynchronous:
Expand Down Expand Up @@ -1578,7 +1578,7 @@ async def close_gracefully(self, restart=None):
"""Gracefully shut down a worker
This first informs the scheduler that we're shutting down, and asks it
to move our data elsewhere. Afterwards, we close as normal
to move our data elsewhere. Afterwards, we close as normal
"""
if self.status in (Status.closing, Status.closing_gracefully):
await self.finished()
Expand Down Expand Up @@ -2272,7 +2272,7 @@ def _transition_from_resumed(
executing -> cancelled -> resumed(fetch)
depending on the origin. Equally, only `fetch`, `waiting` or `released`
depending on the origin. Equally, only `fetch`, `waiting`, or `released`
are allowed output states.
See also `transition_resumed_waiting`
Expand All @@ -2290,7 +2290,7 @@ def _transition_from_resumed(
# If we're not done, yet, just remember where we want to be next
ts._next = finish
else:
# Flight/executing finished unsuccesfully, i.e. not in memory
# Flight/executing finished unsuccessfully, i.e. not in memory
assert finish != "memory"
next_state = ts._next
assert next_state in {"waiting", "fetch"}, next_state
Expand All @@ -2307,17 +2307,13 @@ def _transition_from_resumed(
def transition_resumed_fetch(
self, ts: TaskState, *, stimulus_id: str
) -> RecsInstrs:
"""
See Worker._transition_from_resumed
"""
"""See Worker._transition_from_resumed"""
return self._transition_from_resumed(ts, "fetch", stimulus_id=stimulus_id)

def transition_resumed_missing(
self, ts: TaskState, *, stimulus_id: str
) -> RecsInstrs:
"""
See Worker._transition_from_resumed
"""
"""See Worker._transition_from_resumed"""
return self._transition_from_resumed(ts, "missing", stimulus_id=stimulus_id)

def transition_resumed_released(
Expand All @@ -2333,9 +2329,7 @@ def transition_resumed_released(
def transition_resumed_waiting(
self, ts: TaskState, *, stimulus_id: str
) -> RecsInstrs:
"""
See Worker._transition_from_resumed
"""
"""See Worker._transition_from_resumed"""
return self._transition_from_resumed(ts, "waiting", stimulus_id=stimulus_id)

def transition_cancelled_fetch(
Expand Down

0 comments on commit b8b45c6

Please sign in to comment.