You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recent use-case that caused a minor headache that could maybe have a GPkit-side fix:
Solve a model with some Vectorized variables
Fix the value of a key variable to the optimal solution multiplied by a factor (m.substitutions.update({"velocity": 1.25*sol("velocity").magnitude}). In this instance the variable in question has a Vectorization of 1 so its optimal value is a single-value array.
Re-solve
Save new solution to text file using savetxt()
Everything works fine until step 4, when savetxt returns:
Recent use-case that caused a minor headache that could maybe have a GPkit-side fix:
m.substitutions.update({"velocity": 1.25*sol("velocity").magnitude})
. In this instance the variable in question has a Vectorization of 1 so its optimal value is a single-value array.savetxt()
Everything works fine until step 4, when
savetxt
returns:Probing the initial solution reveals:
Once I figured out the issue, the fix was easy (use
.item()
) but it feels like GPkit should either:savetxt
MWE:
The text was updated successfully, but these errors were encountered: