Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement empty iterable handling and its corresponding tests in batchrunner.py file. #2522

Conversation

Sahil-Chhoker
Copy link
Contributor

Summary

Fixed the handling of empty iterables in _make_model_kwargs. Now raises a ValueError when an empty list is passed.

Bug / Issue

Closes #2108.
Empty iterables weren't properly handled.

Implementation

  • Updated _make_model_kwargs to raise a ValueError for empty iterables.
  • added a new function test_batch_run_with_params_with_empty_content() for testing.

Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 -1.4% [-2.2%, -0.8%] 🔵 -0.9% [-1.2%, -0.6%]
BoltzmannWealth large 🔵 -1.0% [-1.7%, -0.3%] 🟢 -4.8% [-5.9%, -3.8%]
Schelling small 🔵 -0.1% [-0.3%, +0.2%] 🔴 +81.3% [+80.4%, +82.2%]
Schelling large 🔵 -0.9% [-1.3%, -0.5%] 🔴 +82.9% [+80.3%, +85.4%]
WolfSheep small 🔵 +0.9% [+0.6%, +1.2%] 🔵 +1.1% [+0.9%, +1.3%]
WolfSheep large 🔵 +0.3% [-1.3%, +1.7%] 🔵 +3.6% [+0.5%, +7.2%]
BoidFlockers small 🔵 +0.2% [-0.2%, +0.6%] 🔵 +1.0% [+0.1%, +1.9%]
BoidFlockers large 🔵 +0.4% [-0.3%, +1.1%] 🔵 -0.0% [-0.6%, +0.6%]

@Sahil-Chhoker Sahil-Chhoker changed the title Bug fix/empty iterable checks Implement empty iterable handling and its corresponding tests. Nov 29, 2024
@Sahil-Chhoker Sahil-Chhoker changed the title Implement empty iterable handling and its corresponding tests. Implement empty iterable handling and its corresponding tests in batchrunner.py file. Nov 29, 2024
@quaquel
Copy link
Member

quaquel commented Nov 29, 2024

Please start this PR from a clean branch, so without the changes to the Schelling example.

@Sahil-Chhoker
Copy link
Contributor Author

Sorry for the inconvenience, @quaquel. A new branch with the required changes has been reopened.

@quaquel quaquel closed this Nov 29, 2024
@Sahil-Chhoker Sahil-Chhoker deleted the bug-fix/empty-iterable-checks branch November 29, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch_Run begins, performs no iterations, no errors, writes empty .csv file. Help?
2 participants