Commit 4f36110
committed
fix: support scalar/2-elem dim shorthand in tranimate/Animate
tranimate() popped "dims" from kwargs but forwarded it to Animate() as
dim=, and every other function in this codebase (plotvol2, plotvol3)
uses the singular "dim" as the actual keyword name. Calling
tranimate(T, dim=1.5) -- correct per that convention -- left dim=1.5
sitting in **kwargs, colliding with the explicit dim=dim already being
passed to Animate() and raising "got multiple values for keyword
argument 'dim'". Now accepts dim, with dims kept as a back-compat
alias for the previous docstring examples.
Animate.__init__ also had its own hand-rolled dim-length check that
only accepted 2 or 6 elements, so even a correctly-named dim=1.5 would
have failed validation afterward. Replaced it with expand_dims(), the
same helper plotvol3 already uses, so the scalar-shorthand convention
(A -> [-A,A] on every axis) works consistently everywhere.1 parent 8b83c1f commit 4f36110
2 files changed
Lines changed: 13 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
115 | 112 | | |
116 | 113 | | |
117 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3402 | 3402 | | |
3403 | 3403 | | |
3404 | 3404 | | |
3405 | | - | |
3406 | | - | |
| 3405 | + | |
| 3406 | + | |
3407 | 3407 | | |
3408 | 3408 | | |
3409 | 3409 | | |
| |||
3419 | 3419 | | |
3420 | 3420 | | |
3421 | 3421 | | |
3422 | | - | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
3423 | 3425 | | |
3424 | 3426 | | |
3425 | 3427 | | |
| |||
0 commit comments