Skip to content

Conversation

@quaquel
Copy link
Member

@quaquel quaquel commented Oct 28, 2025

The stable version of Ruff (v0.13.3) creates two new errors for MESA: RUF059 and RUF043. This PR fixes both following the suggested fixes from ruff.

Closes #2865

@github-actions
Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +0.7% [+0.1%, +1.4%] 🔵 +1.8% [+1.6%, +2.0%]
BoltzmannWealth large 🔵 +0.0% [-0.3%, +0.3%] 🔵 +1.6% [+1.0%, +2.1%]
Schelling small 🔵 +0.3% [+0.1%, +0.4%] 🔵 +0.2% [+0.1%, +0.3%]
Schelling large 🔵 -0.1% [-0.5%, +0.4%] 🔵 +1.2% [+0.9%, +1.4%]
WolfSheep small 🔵 +0.1% [-0.3%, +0.5%] 🔵 -0.9% [-1.1%, -0.6%]
WolfSheep large 🔵 -0.7% [-1.7%, +0.2%] 🔵 -1.4% [-1.7%, -1.1%]
BoidFlockers small 🔵 +2.4% [+1.4%, +3.7%] 🔵 +1.3% [+0.9%, +1.8%]
BoidFlockers large 🔵 +2.1% [+1.3%, +3.0%] 🔵 +1.2% [+0.6%, +1.8%]

fix broken unit test
@EwoutH
Copy link
Member

EwoutH commented Oct 28, 2025

Awesome, thanks. Could you explain briefly what re.escape does?

@EwoutH EwoutH added maintenance Release notes label ci Release notes label labels Oct 28, 2025
@quaquel
Copy link
Member Author

quaquel commented Oct 28, 2025

I just followed the suggested fix for RUF043 .

From the docs: "Escape special characters in pattern. This is useful if you want to match an arbitrary literal string that may have regular expression metacharacters in it."

Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

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

Thanks! If you could add a few lines to the PR description for future reference, good to go.

@quaquel quaquel merged commit d34f87b into projectmesa:main Oct 28, 2025
13 checks passed
@quaquel quaquel deleted the ruff_fixes branch October 28, 2025 15:13
EwoutH pushed a commit that referenced this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Release notes label maintenance Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Ruff to v0.13 and Fix RUF059 Violations

2 participants