Merged
Conversation
adds test and fix
updates tests, modifies exception and adds sentence to docstring
EventGenerator._get_interval raises a ValueErrror if interval is negative. Tests are updated accordingly .
the idea of stop is that the generator is discarded so there is no sense ot return it
tests are also updated accordingly
|
Performance benchmarks:
|
EwoutH
approved these changes
Feb 18, 2026
Member
EwoutH
left a comment
There was a problem hiding this comment.
Thanks. Indeed backport-worthy.
Krishsharma179
pushed a commit
to Krishsharma179/mesa
that referenced
this pull request
Feb 21, 2026
EwoutH
pushed a commit
that referenced
this pull request
Mar 15, 2026
This commit fixes several minor issues and bugs in `mesa.time` and `mesa.model` related to event scheduling and run control. 1. It moves the relevant tests from `mesa.experimental.test_devs` into a new folder (time) and test_events. This ensures the test structure mimics the layout of the repo. 2. It improves code coverage for Schedule. Specifically, it adds additional tests for the post-init validation. 3. It adds a check that `interval` in the EventGenerator raises an exception if it is negative (in case of callable) and adds a test for this. 4. It removes the return from EventGenerator.stop. The idea of stop is that it stops and deposes the generator. There is no need for a return. 5. The eventlist `__len__` and `__contains__` now ignore canceled events. This is also explicitly tested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes several minor issues and bugs in
mesa.timeandmesa.modelrelated to event scheduling and run control.mesa.experimental.test_devsinto a new folder (time) and test_events. This ensures the test structure mimics the layout of the repo.intervalin the EventGenerator raises an exception if it is negative (in case of callable) and adds a test for this.__len__and__contains__now ignore canceled events. This is also explicitly tested.