Skip to content

test: Replace deprecated iterations with rng in batch_run tests#2984

Merged
EwoutH merged 1 commit intomesa:mainfrom
EwoutH:fix_depr_batch
Dec 22, 2025
Merged

test: Replace deprecated iterations with rng in batch_run tests#2984
EwoutH merged 1 commit intomesa:mainfrom
EwoutH:fix_depr_batch

Conversation

@EwoutH
Copy link
Copy Markdown
Member

@EwoutH EwoutH commented Dec 22, 2025

Summary

Updates test_batch_run.py to eliminate deprecation warnings by replacing the deprecated iterations parameter with the new rng parameter.

Changes

  • Updated three test functions to use rng instead of iterations:
    • test_batch_run: iterations=1rng=[None]
    • test_batch_run_single_core: iterations=6rng=[None] * 6
    • test_batch_run_unhashable_param: iterations=2rng=[None, None]
  • Added test_iterations_deprecation_warning to verify the deprecation warning is raised when using iterations

Testing

All existing tests pass without deprecation warnings. The new test confirms that using iterations still works but raises the appropriate DeprecationWarning

Follow-up on #2841.

Fixes deprecation warnings by updating test calls to use the new `rng` parameter instead of the deprecated `iterations` parameter. Adds a test to verify the deprecation warning is raised correctly.

- Replace `iterations=1` with `rng=[None]`
- Replace `iterations=6` with `rng=[None] * 6`
- Replace `iterations=2` with `rng=[None, None]`
- Add test for deprecation warning
@EwoutH EwoutH requested a review from quaquel December 22, 2025 08:34
@EwoutH EwoutH added the testing Release notes label label Dec 22, 2025
@EwoutH EwoutH merged commit e69e073 into mesa:main Dec 22, 2025
15 checks passed
@github-actions
Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 +0.3% [-0.0%, +0.6%] 🔵 +0.4% [+0.3%, +0.5%]
BoltzmannWealth large 🔵 +0.4% [-1.0%, +3.1%] 🔵 -0.7% [-1.0%, -0.4%]
Schelling small 🔵 -0.3% [-1.2%, +0.7%] 🔵 -0.2% [-0.7%, +0.2%]
Schelling large 🔵 +0.1% [-1.3%, +2.1%] 🔵 +0.2% [-0.2%, +0.7%]
WolfSheep small 🔵 -0.6% [-1.4%, -0.1%] 🔵 +0.3% [+0.2%, +0.5%]
WolfSheep large 🔵 -0.8% [-4.1%, +1.1%] 🔵 -0.9% [-1.3%, -0.4%]
BoidFlockers small 🔵 -2.5% [-2.8%, -2.2%] 🔵 -1.0% [-1.2%, -0.8%]
BoidFlockers large 🔵 -2.8% [-3.3%, -2.4%] 🔵 -1.6% [-1.8%, -1.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.

2 participants