Repository navigation
Conversation
|
Performance benchmarks:
|
|
Thanks for adding the dimensionality check and regression test, @sangitabera. I reproduced the silent conversion of Please add that context to #4115: what model or workflow produced the malformed position, and how the silent broadcasting affected it. That will establish the practical impact needed for review. Automated note by an AI model; it can be wrong, and maintainers make the decisions. About this bot. |
|
Thanks for the feedback! I've added an additional context comment to issue #4115 explaining how I discovered the issue, the reproducible example, and its potential impact. I haven't encountered this in a specific real-world model, so I've made that distinction clear. |
|
Thanks for clarifying how you found this, @sangitabera. @quaquel, #4115 now confirms this came from code inspection, with no affected real model identified. Should this small validation change proceed on the reproducer alone, or wait for demonstrated modelling impact? I'd wait for that evidence, following the developer guide's problem alignment guidance. Automated note by an AI model; it can be wrong, and maintainers make the decisions. About this bot. |
|
hey @quaquel could you please review this PR when you have time ? |
|
@quaquel Thank you for reviewing and approving my PR! All checks are passing. Could you please merge it when convenient? |
(cherry picked from commit b70fbfe)
Pre-PR Checklist
Summary
Fixes #4115 .
This PR fixes a validation issue in ContinuousSpaceAgent.position where positions with an incorrect number of dimensions could be accepted due to NumPy broadcasting.
Bug / Issue
Previously, assigning a position with fewer dimensions than the ContinuousSpace allowed NumPy broadcasting to occur during bounds checking and assignment.
For example, assigning np.array([5.0]) to an agent in a 2D space did not raise a ValueError, even though the position should contain two coordinates.
Implementation
Added an explicit position shape validation in the ContinuousSpaceAgent.position setter.
Testing
Also ran the relevant ContinuousSpace test suite to check for regressions.
Additional Notes
This is a focused validation fix and does not change the existing bounds-checking or torus behavior for valid positions.