Skip to content

Fix run_model_test capturing initial image instead of updated visualization - #3670

Merged
quaquel merged 2 commits into
mesa:mainfrom
Vartika222:fix-visualization-clean
Apr 4, 2026
Merged

quaquel merged 2 commits into
mesa:mainfrom
Vartika222:fix-visualization-clean

Conversation

@Vartika222

Copy link
Copy Markdown
Contributor

run_model_test captures the updated space visualization using locator("img").first, but by that point multiple images exist in the DOM (initial + updated).

.first always selects the initial image, causing the comparison to use identical images and fail incorrectly.

Switching to .last ensures the test captures the correct post-step visualization.

This aligns with the existing usage for changed_graph in the same function.

@github-actions

Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 -2.5% [-3.1%, -1.8%] 🔵 -1.1% [-1.4%, -0.8%]
BoltzmannWealth large 🔵 -0.5% [-1.2%, +0.1%] 🔵 +1.0% [-0.7%, +2.6%]
Schelling small 🔵 +1.8% [+1.1%, +2.4%] 🔵 +2.1% [+1.2%, +3.0%]
Schelling large 🔵 -0.2% [-1.0%, +0.7%] 🔵 +0.0% [-2.4%, +2.5%]
WolfSheep small 🔵 +0.9% [+0.2%, +1.6%] 🔵 +3.5% [-0.4%, +7.7%]
WolfSheep large 🔵 -0.3% [-1.3%, +0.7%] 🔵 +2.0% [+0.5%, +3.4%]
SugarscapeG1mt small 🔵 +2.0% [+1.4%, +2.5%] 🔵 +0.6% [-0.8%, +2.3%]
SugarscapeG1mt large 🔵 +1.9% [+0.2%, +3.5%] 🔵 +1.3% [-0.0%, +2.7%]
BoidFlockers small 🔵 +1.0% [+0.6%, +1.5%] 🔵 +0.6% [+0.1%, +1.0%]
BoidFlockers large 🔵 +1.4% [+0.6%, +2.2%] 🔵 +0.1% [-0.3%, +0.5%]

@quaquel quaquel added the ci Release notes label label Apr 4, 2026
@quaquel
quaquel merged commit 7b53255 into mesa:main Apr 4, 2026
11 checks passed
EwoutH pushed a commit that referenced this pull request Oct 28, 2026
…zation (#3670)

Co-authored-by: Jan Kwakkel <[email protected]>
(cherry picked from commit 7b53255)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants