Skip to content

test: compare JSONDataRecorder data as a list in the plain array test - #4157

Merged
quaquel merged 1 commit into
mesa:mainfrom
ArnabOPP:fix-json-recorder-test-deque
Nov 20, 2026
Merged

quaquel merged 1 commit into
mesa:mainfrom
ArnabOPP:fix-json-recorder-test-deque

Conversation

@ArnabOPP

Copy link
Copy Markdown
Contributor

Pre-PR Checklist

  • This PR is a bug fix, not a new feature or enhancement.

Summary

main currently fails tests/experimental/test_datarecorder.py::test_json_recorder_stores_a_plain_array_as_a_list, which turns every build and the coverage job red for all open PRs.

Bug / Issue

Two merged PRs collided:

assert recorder.data["custom_data"] == [{"time": 0.0, "data": [[1.0, 2.0]]}]
AssertionError: assert deque([{'time...[1.0, 2.0]]}]) == [{'time': 0.0...[[1.0, 2.0]]}]

The build run on the merge commit of #4061 failed for this reason. I found no existing PR or issue for it.

Implementation

Test-only change: convert the stored snapshots to a list before comparing, list(recorder.data["custom_data"]) == [...]. The recorder code is unchanged, and the other tests in the file already treat data as a deque or iterate over it.

Testing

The test passes with this change and fails on main. The rest of the test suite passes locally (excluding the Playwright browser tests) and ruff is clean.

Additional Notes

None.

JSONDataRecorder.data now holds a bounded deque per dataset (mesa#4072), while the test added in mesa#4061 compares it to a list, so main fails test_json_recorder_stores_a_plain_array_as_a_list. Convert to a list before comparing.
Copilot AI balanced review requested due to automatic review settings November 20, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the testing Release notes label label Nov 20, 2026
@github-actions

Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔴 +7.8% [+7.0%, +8.6%] 🔵 +1.3% [+1.0%, +1.5%]
BoltzmannWealth large 🔵 +0.3% [+0.0%, +0.7%] 🔵 +1.0% [+0.3%, +1.9%]
Schelling small 🔵 -1.3% [-1.8%, -0.8%] 🔵 -2.3% [-3.2%, -1.5%]
Schelling large 🔵 -1.4% [-2.1%, -0.7%] 🟢 -7.5% [-9.1%, -5.8%]
WolfSheep small 🔵 -3.0% [-3.4%, -2.7%] 🔵 -3.1% [-5.1%, -1.5%]
WolfSheep large 🔵 -1.4% [-2.0%, -0.8%] 🔵 -2.7% [-4.1%, -1.2%]
SugarscapeG1mt small 🔵 -1.5% [-2.2%, -0.9%] 🔵 -2.1% [-3.8%, -0.4%]
SugarscapeG1mt large 🟢 -5.3% [-7.5%, -3.0%] 🔵 -1.8% [-3.0%, -0.5%]
BoidFlockers small 🔵 -1.5% [-1.9%, -1.0%] 🔵 -0.1% [-0.5%, +0.4%]
BoidFlockers large 🔵 -0.5% [-1.1%, +0.1%] 🔵 -0.0% [-0.3%, +0.2%]
MultiLevelAllianceModel small 🟢 -5.4% [-7.3%, -3.6%] 🔵 -0.1% [-0.3%, +0.1%]
MultiLevelAllianceModel large 🔵 -1.4% [-2.6%, -0.3%] 🔵 -0.8% [-1.0%, -0.5%]

@quaquel
quaquel merged commit e89f241 into mesa:main Nov 20, 2026
18 of 19 checks passed
EwoutH pushed a commit to EwoutH/mesa that referenced this pull request Nov 22, 2026
…mesa#4157)

JSONDataRecorder.data now holds a bounded deque per dataset (mesa#4072), while the test added in mesa#4061 compares it to a list, so main fails test_json_recorder_stores_a_plain_array_as_a_list. Convert to a list before comparing.

(cherry picked from commit e89f241)
EwoutH added a commit to EwoutH/mesa that referenced this pull request Nov 22, 2026
Add mesa#3913, mesa#4061, mesa#4072, mesa#4105, mesa#4126, mesa#4136, mesa#4141, mesa#4157, mesa#4161 and the Starlette 1.x support backported from mesa#4007, and move the release date to 2026-11-22.

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants