Repository navigation
fix(graphics): accept unspecified dimensions in expand_dims - #270
Doribelove wants to merge 2 commits into
Conversation
Signed-off-by: 李永祺 <doribelove@gmail.com>
|
Thanks Dori, and thanks for the clear write-up. This is a nice tidy fix for #261. I merged it with current master locally and the full suite passes (413 passed, 3 skipped). I also checked the four internal callers (plotvol2, plotvol3, Animate, and the dims handling in transforms2d.py). Each one tests for None before calling, so nothing changes for them, and I'm happy to leave them as they are. Checking nd before the None return is a good catch, as is the 0 test showing it's treated as an explicit extent. Approving. (Optional, not blocking: the Black re-wrap in _axes_dimensions is unrelated to this fix. It's fine to keep.) |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Signed-off-by: 李永祺 <doribelove@gmail.com>
|
Merged current master With |
Fixes #261.
expand_dims()raisesTypeErroreven thoughdim=Noneis its documented default. ReturnNonefor an unspecified extent so callers can choose autoscaling or obtain limits elsewhere. Update the argument and return annotations and docstring to describe this behavior.Validate
ndbefore returning, so unsupported dimensions still raiseValueError, including whendimisNone; zero remains an explicit extent. Add regressions for omitted and explicitNonein 2D/3D, explicit numeric extents, malformed vectors, and unsupported dimensions. Preserve the negative-scalar and reversed-limit behavior from #262 and its regression tests.Validation on this branch including upstream master
824a459(MPLBACKEND=Agg):git diff --checkpass. Black also wraps existing long lines in the touched graphics module and test file.The existing internal callers already guard
None. Downstream bdsim behavior has not been tested; thescale=Nonetiming change noted in #261 remains applicable.