Closed 1ozturkbe closed 5 years ago
.as_posyslt1
assumes that it's getting passed a well-formed substitutions dict (scalars, no strings, no Variables, etc.) so you need to give it {b.key: 2}
. Because .sub
isn't speed-critical (it's very rarely used at all), it does a parsesubstitutions()
call.
(this assumption is represented by the parsedsubs=True
argument on https://github.com/convexengineering/gpkit/blob/master/gpkit/nomials/math.py#L500)
Just found something interesting that is somewhat concerning... Here is a MWE.
returns [gpkit.Monomial(a*b^-2)]. And c.substitutions shows up empty. On the other hand, the following:
returns gpkit.Monomial(4*a), as I would expect. What's the exact difference?