mesa
mesa copied to clipboard
Added test for SolaraViz with required model parameters
- Summary
Adds a minimal regression test ensuring that SolaraViz correctly handles models with required constructor parameters when those parameters are supplied through model_params.
Related Issue : #2722
- Background
Users previously reported a ValueError: Missing required model parameter when using models with required parameters (e.g., MoneyModel(n, width, height)), even though the parameters were passed via model_params. This behavior has already been fixed in the current codebase.
- What This PR Does
This PR adds a minimal test to confirm the fix. No code changes were required.
- Test Added : tests/test_solara_required_params.py
Result:
1 passed, 1 warning in 4.78s
Performance benchmarks:
| Model | Size | Init time [95% CI] | Run time [95% CI] |
|---|---|---|---|
| BoltzmannWealth | small | 🔴 +4.7% [+3.7%, +5.7%] | 🔵 -0.9% [-1.1%, -0.7%] |
| BoltzmannWealth | large | 🔵 +4.9% [-12.3%, +24.7%] | 🔴 +9.6% [+6.4%, +12.5%] |
| Schelling | small | 🔵 +2.1% [+1.9%, +2.3%] | 🔵 +0.1% [-0.1%, +0.3%] |
| Schelling | large | 🔵 +4.0% [-13.9%, +24.7%] | 🔴 +21.6% [+5.2%, +48.3%] |
| WolfSheep | small | 🔴 +3.9% [+3.6%, +4.3%] | 🔵 +0.8% [+0.6%, +0.9%] |
| WolfSheep | large | 🔵 -11.8% [-36.5%, +6.3%] | 🔵 +18.1% [-5.7%, +44.5%] |
| BoidFlockers | small | 🔵 +2.1% [+1.7%, +2.7%] | 🔵 +1.3% [+1.1%, +1.4%] |
| BoidFlockers | large | 🔵 +1.8% [+1.4%, +2.4%] | 🔵 +1.0% [+0.8%, +1.3%] |
@EwoutH @quaquel Please review my PR.