Skip to content

Remove unneeded int cast#2791

Merged
quaquel merged 1 commit intomesa:mainfrom
derkweijers:fix-pre-commit-int
May 20, 2025
Merged

Remove unneeded int cast#2791
quaquel merged 1 commit intomesa:mainfrom
derkweijers:fix-pre-commit-int

Conversation

@derkweijers
Copy link
Copy Markdown
Contributor

@derkweijers derkweijers commented May 20, 2025

Summary

round() implicitely returned an int, which was later cast to an int again. This can be avoided.

Bug / Issue

Implementation

I've removed the call to int() and gave a second argument of None to round() so it explicitly returns an int.

Testing

This makes Ruff happy again, as it was failing because of the double int cast.

Additional Notes

@derkweijers derkweijers marked this pull request as ready for review May 20, 2025 15:59
@github-actions
Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +3.6% [+2.3%, +5.0%] 🔵 -0.1% [-0.3%, +0.1%]
BoltzmannWealth large 🔵 +0.4% [-0.8%, +1.5%] 🔵 +1.8% [-1.4%, +4.7%]
Schelling small 🔵 -0.7% [-1.0%, -0.4%] 🔵 -0.5% [-0.7%, -0.3%]
Schelling large 🔵 -1.1% [-2.2%, -0.0%] 🔵 -4.2% [-6.5%, -2.2%]
WolfSheep small 🔵 +0.2% [-0.2%, +0.5%] 🔵 +0.1% [-0.1%, +0.3%]
WolfSheep large 🔵 +0.5% [-0.9%, +2.0%] 🔵 -0.2% [-3.8%, +3.0%]
BoidFlockers small 🔵 -1.8% [-2.4%, -1.2%] 🔵 -0.9% [-1.1%, -0.6%]
BoidFlockers large 🔵 -2.2% [-2.8%, -1.6%] 🔵 -1.3% [-1.6%, -1.0%]

@github-actions
Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔴 +4.2% [+3.4%, +5.1%] 🔵 +1.2% [+0.9%, +1.5%]
BoltzmannWealth large 🔵 +2.7% [+1.5%, +4.2%] 🔴 +14.3% [+9.1%, +19.8%]
Schelling small 🔵 +0.5% [+0.2%, +0.9%] 🔵 +2.5% [+1.7%, +3.4%]
Schelling large 🔵 +0.6% [+0.0%, +1.2%] 🔵 +1.1% [-0.1%, +2.2%]
WolfSheep small 🔵 -0.1% [-0.4%, +0.2%] 🔵 +0.9% [+0.7%, +1.1%]
WolfSheep large 🔵 +3.1% [+2.2%, +4.1%] 🔵 +3.5% [+2.4%, +4.6%]
BoidFlockers small 🔵 -2.0% [-2.8%, -1.3%] 🔵 -1.7% [-2.0%, -1.5%]
BoidFlockers large 🔵 -3.5% [-4.0%, -3.0%] 🔵 -2.6% [-2.9%, -2.4%]

Copy link
Copy Markdown
Member

@quaquel quaquel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@quaquel quaquel merged commit cc1d14d into mesa:main May 20, 2025
14 checks passed
@tpike3 tpike3 added the bug Release notes label label Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants