Fix: Handle capacity=None in Cell.is_full property#2981
Merged
Conversation
|
Performance benchmarks:
|
EwoutH
reviewed
Dec 21, 2025
Member
EwoutH
left a comment
There was a problem hiding this comment.
Thanks!
Code looks good, one comment on the tests
5d21506 to
f52dfa1
Compare
Fixes mesa#2980 - Add explicit None check for infinite capacity - Change == to >= to handle edge cases - Add comprehensive tests for None and finite capacity
f52dfa1 to
3b13e98
Compare
af5c015 to
7faf712
Compare
Member
|
From my perspective, this is ready to be merged. I'll wait for @EwoutH before merging. |
EwoutH
approved these changes
Dec 22, 2025
Member
|
Nice clean final diff, thanks! (we do require docstring for every function, a single line is often enough for tests. See 6420ae2) |
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.
Fixes #2980
This PR fixes the type comparison error in
Cell.is_fullwhencapacity=None.Changes
Nonecheck for infinite capacity==to>=to handle edge cases where agents exceed capacityTesting
All new tests pass:
test_cell_is_full_with_capacity_exceeded