Skip to content

Commit

Permalink
Fix pre-commit issues: Codespel and typecheck (#2161)
Browse files Browse the repository at this point in the history
Fixes two things pre-commit detected:
- Some codespell errors
- A case of E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
  • Loading branch information
EwoutH committed Jul 3, 2024
1 parent 0f3fe74 commit f3f98ee
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ inactivate
ue
fpr
falsy
assertIn
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/adv_tutorial_legacy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"\n",
"![Redcircles Visualization](files/viz_redcircles.png)\n",
"\n",
"Click `Step` to advance the model by one step, and the agents will move around. Click `Start` and the agents will keep moving around, at the rate set by the 'fps' (frames per second) slider at the top. Try moving it around and see how the speed of the model changes. Pressing `Stop` will pause the model; presing `Start` again will restart it. Finally, `Reset` will start a new instantiation of the model.\n",
"Click `Step` to advance the model by one step, and the agents will move around. Click `Start` and the agents will keep moving around, at the rate set by the 'fps' (frames per second) slider at the top. Try moving it around and see how the speed of the model changes. Pressing `Stop` will pause the model; pressing `Start` again will restart it. Finally, `Reset` will start a new instantiation of the model.\n",
"\n",
"To stop the visualization server, go back to the terminal where you launched it, and press Control+c."
]
Expand Down
2 changes: 1 addition & 1 deletion mesa/visualization/UserParam.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
if dtype is None:
self.is_float_slider = self._check_values_are_float(value, min, max, step)
else:
self.is_float_slider = dtype == float
self.is_float_slider = dtype is float

def _check_values_are_float(self, value, min, max, step):
return any(isinstance(n, float) for n in (value, min, max, step))
Expand Down

0 comments on commit f3f98ee

Please sign in to comment.