Skip to content

Commit 05d643b

Browse files
committed
bump pre-commit hooks
1 parent 040f5fd commit 05d643b

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
3+
rev: v4.0.1
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -9,19 +9,19 @@ repos:
99
- id: debug-statements
1010
- id: check-ast
1111
- repo: https://github.com/ambv/black
12-
rev: 20.8b1
12+
rev: 21.9b0
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/asottile/pyupgrade
16-
rev: v2.11.0
16+
rev: v2.27.0
1717
hooks:
1818
- id: pyupgrade
1919
args: ['--py37-plus']
2020
- repo: https://github.com/timothycrosley/isort
21-
rev: 5.8.0
21+
rev: 5.9.3
2222
hooks:
2323
- id: isort
2424
- repo: https://gitlab.com/pycqa/flake8
25-
rev: 3.9.0
25+
rev: 3.9.2
2626
hooks:
2727
- id: flake8

adaptive/learner/integrator_coeffs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _coefficients():
162162
]
163163

164164
# Compute the shift matrices.
165-
T_left, T_right = [V_inv[3] @ calc_V((xi[3] + a) / 2, ns[3]) for a in [-1, 1]]
165+
T_left, T_right = (V_inv[3] @ calc_V((xi[3] + a) / 2, ns[3]) for a in [-1, 1])
166166

167167
# If the relative difference between two consecutive approximations is
168168
# lower than this value, the error estimate is considered reliable.

adaptive/learner/learner1D.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,10 @@ def tell_many(
557557
self._oldscale = deepcopy(self._scale)
558558

559559
# Find the intervals for which the losses should be calculated.
560-
intervals, intervals_combined = [
560+
intervals, intervals_combined = (
561561
[(x_m, x_r) for x_m, (x_l, x_r) in neighbors.items()][:-1]
562562
for neighbors in (self.neighbors, self.neighbors_combined)
563-
]
563+
)
564564

565565
# The the losses for the "real" intervals.
566566
self.losses = loss_manager(self._scale[0])

adaptive/notebook_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def _info_html(runner):
251251

252252
overhead = runner.overhead()
253253
red_level = max(0, min(int(255 * overhead / 100), 255))
254-
overhead_color = "#{:02x}{:02x}{:02x}".format(red_level, 255 - red_level, 0)
254+
overhead_color = f"#{red_level:02x}{255 - red_level:02x}{0:02x}"
255255

256256
info = [
257257
("status", f'<font color="{color}">{status}</font>'),

adaptive/tests/test_cquad.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def equal_ival(ival, other, *, verbose=False):
3636
b = getattr(other, s)
3737
is_equal = np.allclose(a, b, rtol=0, atol=eps, equal_nan=True)
3838
if verbose and not is_equal:
39-
print("ival.{} - other.{} = {}".format(s, s, a - b))
39+
print(f"ival.{s} - other.{s} = {a - b}")
4040
same_slots.append(is_equal)
4141

4242
return all(same_slots)
@@ -46,7 +46,7 @@ def equal_ivals(ivals, other, *, verbose=False):
4646
"""Note: `other` is a list of ivals."""
4747
if len(ivals) != len(other):
4848
if verbose:
49-
print("len(ivals)={} != len(other)={}".format(len(ivals), len(other)))
49+
print(f"len(ivals)={len(ivals)} != len(other)={len(other)}")
5050
return False
5151

5252
ivals = [sorted(i, key=attrgetter("a")) for i in [ivals, other]]

0 commit comments

Comments
 (0)