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

[pre-commit.ci] pre-commit autoupdate #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- repo: https://github.com/asottile/pyupgrade
# Do not upgrade: there's a bug in Cython that causes sum(... for ...) to fail;
# it needs sum([... for ...])
rev: v2.13.0
rev: v2.31.1
hooks:
- id: pyupgrade
args:
Expand All @@ -20,13 +20,13 @@ repos:
exclude: versioneer.py
args:
- --target-version=py38
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.931
rev: v0.941
hooks:
- id: mypy
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@ def _get_timeseries(self, restrict_to_existing=False):
back = None
# Remove any periods of zero compute at the front or back of the timeseries
if len(self.plugin.compute):
agg = sum([np.array(v[front:]) for v in self.plugin.compute.values()])
agg = sum(np.array(v[front:]) for v in self.plugin.compute.values())
front2 = len(agg) - len(np.trim_zeros(agg, trim="f"))
front += front2
back = len(np.trim_zeros(agg, trim="b")) - len(agg) or None
Expand Down
18 changes: 9 additions & 9 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,15 +1019,15 @@ def __repr__(self):
@property
def nbytes_total(self):
tg: TaskGroup
return sum([tg._nbytes_total for tg in self._groups])
return sum(tg._nbytes_total for tg in self._groups)

def __len__(self):
return sum(map(len, self._groups))

@property
def duration(self):
tg: TaskGroup
return sum([tg._duration for tg in self._groups])
return sum(tg._duration for tg in self._groups)

@property
def types(self):
Expand Down Expand Up @@ -6816,9 +6816,9 @@ def workers_to_close(
groups = groupby(key, parent._workers.values())

limit_bytes = {
k: sum([ws._memory_limit for ws in v]) for k, v in groups.items()
k: sum(ws._memory_limit for ws in v) for k, v in groups.items()
}
group_bytes = {k: sum([ws._nbytes for ws in v]) for k, v in groups.items()}
group_bytes = {k: sum(ws._nbytes for ws in v) for k, v in groups.items()}

limit = sum(limit_bytes.values())
total = sum(group_bytes.values())
Expand Down Expand Up @@ -7780,9 +7780,9 @@ def profile_to_figure(state):
tasks_timings=tasks_timings,
address=self.address,
nworkers=len(parent._workers_dv),
threads=sum([ws._nthreads for ws in parent._workers_dv.values()]),
threads=sum(ws._nthreads for ws in parent._workers_dv.values()),
memory=format_bytes(
sum([ws._memory_limit for ws in parent._workers_dv.values()])
sum(ws._memory_limit for ws in parent._workers_dv.values())
),
code=code,
dask_version=dask.__version__,
Expand Down Expand Up @@ -8027,8 +8027,8 @@ def adaptive_target(self, target_duration=None):
cpu = max(1, cpu)

# add more workers if more than 60% of memory is used
limit = sum([ws._memory_limit for ws in parent._workers_dv.values()])
used = sum([ws._nbytes for ws in parent._workers_dv.values()])
limit = sum(ws._memory_limit for ws in parent._workers_dv.values())
used = sum(ws._nbytes for ws in parent._workers_dv.values())
memory = 0
if used > 0.6 * limit and limit > 0:
memory = 2 * len(parent._workers_dv)
Expand Down Expand Up @@ -8481,7 +8481,7 @@ def validate_task_state(ts: TaskState):

if ts._actor:
if ts._state == "memory":
assert sum([ts in ws._actors for ws in ts._who_has]) == 1
assert sum(ts in ws._actors for ws in ts._who_has) == 1
if ts._state == "processing":
assert ts in ts._processing_on.actors

Expand Down