Skip to content

Commit 7731c80

Browse files
EwoutHrht
authored andcommitted
Fix pre-commit
Make pre-commit fully green again
1 parent 7f49ca9 commit 7731c80

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

examples/boid_flockers/boid_flockers/SimpleContinuousModule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def __init__(self, portrayal_method=None, canvas_height=500, canvas_width=500):
1111
self.portrayal_method = portrayal_method
1212
self.canvas_height = canvas_height
1313
self.canvas_width = canvas_width
14-
new_element = "new Simple_Continuous_Module({}, {})".format(
15-
self.canvas_width, self.canvas_height
14+
new_element = (
15+
f"new Simple_Continuous_Module({self.canvas_width}, {self.canvas_height})"
1616
)
1717
self.js_code = "elements.push(" + new_element + ");"
1818

examples/virus_on_network/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ def get_resistant_susceptible_ratio(model):
4141
ratio_text = r"$\infty$" if ratio is math.inf else f"{ratio:.2f}"
4242
infected_text = str(number_infected(model))
4343

44-
return "Resistant/Susceptible Ratio: {}<br>Infected Remaining: {}".format(
45-
ratio_text, infected_text
46-
)
44+
return f"Resistant/Susceptible Ratio: {ratio_text}<br>Infected Remaining: {infected_text}"
4745

4846

4947
def make_plot(model):

examples/virus_on_network/virus_on_network/server.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ def get_resistant_susceptible_ratio(model):
6868
ratio_text = "&infin;" if ratio is math.inf else f"{ratio:.2f}"
6969
infected_text = str(number_infected(model))
7070

71-
return "Resistant/Susceptible Ratio: {}<br>Infected Remaining: {}".format(
72-
ratio_text, infected_text
73-
)
71+
return f"Resistant/Susceptible Ratio: {ratio_text}<br>Infected Remaining: {infected_text}"
7472

7573

7674
model_params = {

gis/agents_and_networks/src/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def logger(func):
77
@wraps(func)
88
def wrapper(*args, **kwargs):
99
logger = logging.getLogger(func.__name__)
10-
logger.info("About to run %s" % func.__name__)
10+
logger.info(f"About to run {func.__name__}")
1111
out = func(*args, **kwargs)
12-
logger.info("Done running %s" % func.__name__)
12+
logger.info(f"Done running {func.__name__}")
1313
return out
1414

1515
return wrapper

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ build-backend = "setuptools.build_meta"
1818

1919
[tool.ruff]
2020
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
21-
select = [
21+
lint.select = [
2222
# "ANN", # annotations TODO
2323
"B", # bugbear
2424
"C4", # comprehensions
@@ -51,7 +51,7 @@ select = [
5151
# But we don't specify them because ruff's Black already
5252
# checks for it.
5353
# See https://github.com/charliermarsh/ruff/issues/1842#issuecomment-1381210185
54-
extend-ignore = [
54+
lint.extend-ignore = [
5555
"E501",
5656
"S101", # Use of `assert` detected
5757
"B017", # `assertRaises(Exception)` should be considered evil TODO

0 commit comments

Comments
 (0)