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

isinstance(constraint, SignomialEquality) 'not working' #1354

Open
1ozturkbe opened this issue Sep 10, 2018 · 1 comment
Open

isinstance(constraint, SignomialEquality) 'not working' #1354

1ozturkbe opened this issue Sep 10, 2018 · 1 comment

Comments

@1ozturkbe
Copy link
Contributor

This seems somewhat trivial, but for a model with Signomial Equalities, the following does not work:

all_constraints = model.flat(constraintsets=False)
for cs in all_constraints:
    if isinstance(cs, SignomialEquality):
        print cs

However, this works:

all_constraints = model.flat(constraintsets=False)
for cs in all_constraints:
    if isinstance(cs, SingleSignomialEquality):
        print cs

This is obviously because all SignomialEqualities are of type SingleSignomial Equality. This is when I struck this gem:

        # TODO: really it should be easier to vectorize a constraint

Why is it difficult to vectorize SigEqs @bqpd? The results can be messy on the user's end.

@bqpd
Copy link
Contributor

bqpd commented Sep 11, 2018

I think there's an issue on this already; long story short, you're welcome to try, but without operator overloading it's difficult to get arrays and scalars to act the same without creating a second "interface" (SignomialEquality) to the underlying low-level constraint (SingleSignomialEquality)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants