-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial vector substitution #1531
Conversation
test models please |
@pgkirsch what do you think of this feature's utility? It seems to me like something that should Just Work, so I'm willing to take the performance hit...but that's easy for me to say. |
@bqpd that seems helpful! This seems like it would further simplify the proposed aero changes? I assume that syntax carries over to the setup method form? def setup(self):
...
substitutions = {
v[0,2:]: 1,
...
}
return constraints, substitutions I know I'm sort of pushing the envelope on some of these vector variable subs, but do you have other users with anything similar in use case? |
yup, carries over! I think this is one of those things where people might have tried to use it, it didn't work, they found an alternative without mentioning... |
Awesome! Have you profiled what the performance hit is for a large model? I can't imagine it's too significant, right? |
it was ~4% of the time in that function...don't remember exactly the timing
in my test run, but no more than a couple hundredths of a second.
… |
Seems very tolerable! |
I'm just so used to making things quicker when I make changes to core classes :p |
Ha sorry! |
test models please |
allows substitutions like
m.substitutions[v[0,2:]] = 1 # or np.ones(v[0,2:].shape)