Skip to content

test: ensure DataCollector raises ValueError when collecting data for…#3053

Merged
quaquel merged 10 commits intomesa:mainfrom
disgruntled-penguin:test/datacollector-invalid-agent-type
Jan 5, 2026
Merged

test: ensure DataCollector raises ValueError when collecting data for…#3053
quaquel merged 10 commits intomesa:mainfrom
disgruntled-penguin:test/datacollector-invalid-agent-type

Conversation

@disgruntled-penguin
Copy link
Copy Markdown
Contributor

… non-Agent types

This PR adds a test case to tests/test_datacollector.py to ensure the DataCollector raises a ValueError when collect is called with an object that is not a Mesa Agent

  • Added test_collect_with_non_agent to verify that passing a non-agent object (like a string or integer) to DataCollector.collect raises a ValueError
  • Fixes implicit behavior where non-agent objects might be processed silently or cause confusing errors later

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 2, 2026

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +3.6% [+2.7%, +4.4%] 🔵 +0.7% [+0.5%, +0.9%]
BoltzmannWealth large 🔵 +1.0% [+0.2%, +1.7%] 🔵 +4.5% [+1.3%, +8.3%]
Schelling small 🔵 +1.1% [+0.1%, +2.1%] 🔵 +0.4% [-0.1%, +0.9%]
Schelling large 🔵 +0.4% [-0.7%, +1.4%] 🔵 +5.8% [+0.4%, +11.2%]
WolfSheep small 🔵 -0.1% [-0.4%, +0.3%] 🔵 +0.6% [+0.4%, +0.9%]
WolfSheep large 🔵 -0.6% [-6.0%, +5.3%] 🔵 -1.3% [-5.7%, +2.9%]
BoidFlockers small 🔵 -0.7% [-1.3%, -0.1%] 🔵 +0.2% [-0.0%, +0.4%]
BoidFlockers large 🔵 -1.5% [-2.0%, -1.0%] 🔵 -0.6% [-1.0%, -0.2%]

@quaquel quaquel added the testing Release notes label label Jan 2, 2026
@quaquel quaquel merged commit cd16579 into mesa:main Jan 5, 2026
14 checks passed
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.

2 participants