Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
Make pre-commit fully green again
  • Loading branch information
EwoutH authored and rht committed Jul 4, 2024
1 parent 7f49ca9 commit 7731c80
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def __init__(self, portrayal_method=None, canvas_height=500, canvas_width=500):
self.portrayal_method = portrayal_method
self.canvas_height = canvas_height
self.canvas_width = canvas_width
new_element = "new Simple_Continuous_Module({}, {})".format(
self.canvas_width, self.canvas_height
new_element = (
f"new Simple_Continuous_Module({self.canvas_width}, {self.canvas_height})"
)
self.js_code = "elements.push(" + new_element + ");"

Expand Down
4 changes: 1 addition & 3 deletions examples/virus_on_network/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def get_resistant_susceptible_ratio(model):
ratio_text = r"$\infty$" if ratio is math.inf else f"{ratio:.2f}"
infected_text = str(number_infected(model))

return "Resistant/Susceptible Ratio: {}<br>Infected Remaining: {}".format(
ratio_text, infected_text
)
return f"Resistant/Susceptible Ratio: {ratio_text}<br>Infected Remaining: {infected_text}"


def make_plot(model):
Expand Down
4 changes: 1 addition & 3 deletions examples/virus_on_network/virus_on_network/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ def get_resistant_susceptible_ratio(model):
ratio_text = "&infin;" if ratio is math.inf else f"{ratio:.2f}"
infected_text = str(number_infected(model))

return "Resistant/Susceptible Ratio: {}<br>Infected Remaining: {}".format(
ratio_text, infected_text
)
return f"Resistant/Susceptible Ratio: {ratio_text}<br>Infected Remaining: {infected_text}"


model_params = {
Expand Down
4 changes: 2 additions & 2 deletions gis/agents_and_networks/src/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ def logger(func):
@wraps(func)
def wrapper(*args, **kwargs):
logger = logging.getLogger(func.__name__)
logger.info("About to run %s" % func.__name__)
logger.info(f"About to run {func.__name__}")
out = func(*args, **kwargs)
logger.info("Done running %s" % func.__name__)
logger.info(f"Done running {func.__name__}")
return out

return wrapper
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build-backend = "setuptools.build_meta"

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

0 comments on commit 7731c80

Please sign in to comment.