Skip to content

Commit

Permalink
Fix remaining Ruff errors manually
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Jun 25, 2023
1 parent 1a92049 commit 311e713
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/virus_on_network/virus_on_network/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ def try_remove_infection(self):
self.state = State.INFECTED

def try_check_situation(self):
if self.random.random() < self.virus_check_frequency:
# Checking...
if self.state is State.INFECTED:
self.try_remove_infection()
if (self.random.random() < self.virus_check_frequency) and (
self.state is State.INFECTED
):
self.try_remove_infection()

def step(self):
if self.state is State.INFECTED:
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ extend-ignore = [
"N802", # Function name should be lowercase
"N999", # Invalid module name. We should revisit this in the future, TODO
"B007", # Loop control variable `i` not used within loop body
"N806", # Variable `N` in function should be lowercase
"N803", # Argument name `N` should be lowercase
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` TODO
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes TODO
"B008", # Do not perform function call `pyproj.CRS` in argument defaults TODO
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue TODO
]
# Hardcode to Python 3.8.
target-version = "py38"
Expand Down

0 comments on commit 311e713

Please sign in to comment.