Skip to content
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

Merged
merged 4 commits into from
Dec 2, 2020
Merged

Partial vector substitution #1531

merged 4 commits into from
Dec 2, 2020

Conversation

bqpd
Copy link
Contributor

@bqpd bqpd commented Dec 1, 2020

allows substitutions like m.substitutions[v[0,2:]] = 1 # or np.ones(v[0,2:].shape)

@bqpd
Copy link
Contributor Author

bqpd commented Dec 1, 2020

test models please

@bqpd
Copy link
Contributor Author

bqpd commented Dec 1, 2020

@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.

@pgkirsch
Copy link
Contributor

pgkirsch commented Dec 2, 2020

@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?

@bqpd
Copy link
Contributor Author

bqpd commented Dec 2, 2020

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...

@pgkirsch
Copy link
Contributor

pgkirsch commented Dec 2, 2020

Awesome!

Have you profiled what the performance hit is for a large model? I can't imagine it's too significant, right?

@bqpd
Copy link
Contributor Author

bqpd commented Dec 2, 2020 via email

@pgkirsch
Copy link
Contributor

pgkirsch commented Dec 2, 2020

Seems very tolerable!

@bqpd
Copy link
Contributor Author

bqpd commented Dec 2, 2020

I'm just so used to making things quicker when I make changes to core classes :p

@pgkirsch
Copy link
Contributor

pgkirsch commented Dec 2, 2020

Ha sorry!

@bqpd
Copy link
Contributor Author

bqpd commented Dec 2, 2020

test models please

@bqpd bqpd merged commit 9dd245e into master Dec 2, 2020
@bqpd bqpd deleted the partvecsub branch December 2, 2020 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants