Fix/datacollector missing attribute error#3041
Merged
Conversation
|
Performance benchmarks:
|
079921a to
a55eaa8
Compare
Member
|
Thanks for the PR. It now changes over a 1000 lines of code, that can’t be right? |
Contributor
Author
|
@EwoutH sorry it's a wrong push I will update it. It's just few lines update. |
- Add validation in _new_agent_reporter() to check attribute exists - Add validation in _new_agenttype_reporter() for consistency - Raise AttributeError with informative message if attribute missing - Includes agent ID, agent type, attribute name, and reporter name - Prevents silent data loss in agent reporters - Add 3 comprehensive test cases: * test_agent_missing_attribute_error() * test_agent_valid_attributes_still_work() * test_lambda_reporters_still_work() - All 18 tests passing - No breaking changes
b06d9b0 to
d066fb1
Compare
Contributor
Author
|
@EwoutH I have updated the PR. |
quaquel
reviewed
Dec 30, 2025
454008f to
0bdc98d
Compare
|
Performance benchmarks:
|
quaquel
approved these changes
Dec 30, 2025
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.
Problem
DataCollector silently skipped reporters for non-existent agent attributes,
causing silent data loss.
Solution
Added validation to raise AttributeError with informative message including:
Changes
mesa/datacollection.pytests/test_datacollector.pyTesting
To Reproduce
Run the below code