tests: Update agent portrayals to use AgentPortrayalStyle#2909
Merged
tests: Update agent portrayals to use AgentPortrayalStyle#2909
Conversation
|
Performance benchmarks:
|
quaquel
approved these changes
Dec 3, 2025
EwoutH
approved these changes
Dec 3, 2025
Member
|
Thanks! |
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.
PR: Migrate Test Agent Portrayals to
AgentPortrayalStyle(Part of #2904)This PR updates
tests/test_components_matplotlib.pyto use the newAgentPortrayalStyleAPI rather than legacy dict-based portrayals.It reduces deprecation warnings and ensures the test suite reflects the modern visualization interface.
🔧 Issue Reference
Linked: #2904 — Migration away from deprecated dict-based agent portrayals toward
AgentPortrayalStyle.Previously, several tests defined
agent_portrayalfunctions returning dicts like:These have been deprecated. The visualization system now expects an
AgentPortrayalStyleinstance, leading to noisy warnings and inconsistencies in the test suite.🛠️ Implementation Details
✔ Updated Imports
✔ Refactored Test Portrayal Functions
All portrayal functions in
tests/test_components_matplotlib.pyhave been updated to returnAgentPortrayalStyleinstead of dicts.✔ Key Mappings (Legacy → New API)
These mappings preserve the previous semantics—same markers, colors, sizes, and alpha values.
🧪 Testing
Executed focused test suites:
✅ Result
21 tests passed
Only pre-existing warnings remain
No new errors introduced
Tests now exercise the updated portrayal API cleanly
📌 Notes
This PR intentionally targets only the test layer, aligning with the incremental migration plan discussed in Tracking issue: Resolve test suite warnings #2904.
Core visualization code already supports
AgentPortrayalStyle; these changes ensure tests validate the new API correctly.