Conversation
Contributor
Author
|
todo: implement this or something similar as a test: from gpkit import *
from gpkit.constraints.relax import ConstantsRelaxed
x = VectorVariable(3, "x")
y = VectorVariable(3, "y")
ymax = VectorVariable(3, "ymax")
with SignomialsEnabled():
m = Model(x.prod(), [x + y >= 1, y <= ymax])
m.substitutions.update({"ymax": [0.3, 0.5, 0.8]})
print m.localsolve().summary() |
Contributor
|
@whoburg it'd really help us do some much needed clean up in the D8 code if this gets merged |
whoburg
requested changes
Apr 14, 2017
gpkit/keydict.py
Outdated
| # KeyDict values are expected to be immutable (Numbers) | ||
| # or to have a copy attribute. | ||
| v = v.copy() | ||
| if (isinstance(k, VarKey) and k.shape |
Collaborator
There was a problem hiding this comment.
move isinstance call to the end of the list of conditions, for speed?
gpkit/keydict.py
Outdated
| # or to have a copy attribute. | ||
| v = v.copy() | ||
| if (isinstance(k, VarKey) and k.shape | ||
| and not k.idx and not isinstance(v, np.ndarray)): |
Collaborator
There was a problem hiding this comment.
inline comment desperately needed.
Collaborator
|
added @bqpd's suggested test. |
whoburg
approved these changes
Apr 14, 2017
Collaborator
|
I set the review status to approved so that @bqpd can merge, but please add the inline comment first |
Contributor
|
@bqpd updates? |
Contributor
Author
|
@mayork, it's merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes convexengineering/SPaircraft#37
@whoburg, ready for review