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

Connector features #290

Closed
eslickj opened this issue Dec 22, 2017 · 12 comments
Closed

Connector features #290

eslickj opened this issue Dec 22, 2017 · 12 comments

Comments

@eslickj
Copy link
Contributor

eslickj commented Dec 22, 2017

Connectors would be more useful with a few additional features

  1. It would be helpful if constraints that connect two connectors were easier to identify without looking at the variables in every constraint and checking if they are connectors. Maybe connections could be their own special subclass of constraint.
  2. Once the connectors are expanded, it would be also nice if the resulting constraints could be related back to the connection in some way and could be easily activated or deactivated as a group like connection.deactivate() and that would deactivate the constraints that result from the expanded constraint.
  3. It would also be nice to be able to deactivate just a particular constraint in a connection. Like if connectors had T and P in them, you could do something like connection.deactivate("T")
  4. Slicing would be nice also Connectors do not support sliced variables #227
@qtothec
Copy link
Contributor

qtothec commented Dec 22, 2017

I'm not sure what the impact on performance would be, but core.expand_connectors could create a ComponentMap linking the connector constraints to a block where their expanded form resides, similar to how the GDP transformation works. Deactivating that block would thus provide the functionality in (2). I think that pulling (3) off would be a good bit more difficult, especially working around @jsiirola's aggregators.

@andrewlee94
Copy link
Contributor

Another feature that I have found myself wishing for is the ability to fix and unfix an associated Var through a Connector. Whilst I can always go and fix the Var in its parent component, sometimes it would be more convenient to do so through the Connector. In many cases, the Connector is the most obvious outward facing component of the model, rather than the associatedVar which might be buried deeper in the model structure.

@qtothec
Copy link
Contributor

qtothec commented Jan 3, 2018

@andrewlee94 To clarify, are you looking to simultaneously fix all of the Var objects associated with a particular Connector? You are able to access the vars associated with a connector already.

@andrewlee94
Copy link
Contributor

andrewlee94 commented Jan 3, 2018

This may be more specific to indexed connectors, but I would like to be able to write something like model.connector[x].var_1.fix(...). Currently if I try that I get an AttributeError saying:
'_ConnectorData' object has no attribute 'var_1'

@qtothec
Copy link
Contributor

qtothec commented Jan 3, 2018 via email

@andrewlee94
Copy link
Contributor

@qtothec Well there you go, thank you for pointing that out. I had thought it was an obvious feature to have.

@jsiirola
Copy link
Member

jsiirola commented Jan 4, 2018

There's a lot of good ideas here. Connectors are an old feature and are (over)due for a revamp. Can we carve out some time next week for the 3 of us to break out and write down the use cases - both the ones we are using now and the new features above?

@qtothec
Copy link
Contributor

qtothec commented Jan 4, 2018

Yes, I think that would be a good plan. Connectors are pretty high up my list of agenda items. I'm currently working on a prioritized list of software framework issues.

@jsiirola
Copy link
Member

jsiirola commented Jan 4, 2018

Fantastic.

@blnicho
Copy link
Member

blnicho commented Jan 6, 2018

Another use case that should be discussed is adding ContinuousSet indexed variables to a Connector. I have some ideas on how to "re-expand" an already expanded Connector when applying a discretization transformation but if there is a way to incorporate this into a Connector re-design I think it would be a better long-term solution.

@qtothec qtothec added this to To Do [unsorted] in IDAES Priorities Jan 12, 2018
@eslickj
Copy link
Contributor Author

eslickj commented Feb 9, 2018

I don't think we ever settled the connector design at the January meeting. I would probably be good to follow up on this soon.

@blnicho blnicho moved this from To Do [default priority] to High priority in IDAES Priorities Feb 12, 2018
@blnicho blnicho added this to Nominations in Pyomo 5.6 Release Feb 14, 2018
@blnicho
Copy link
Member

blnicho commented Aug 3, 2018

Closing this as most of it was resolved in #583. New issues should be opened for any feature requests in pyomo.network.

@blnicho blnicho closed this as completed Aug 3, 2018
IDAES Priorities automation moved this from High priority to Done Aug 3, 2018
Pyomo 5.6 Release automation moved this from Nominations to Done Aug 3, 2018
Pyomo Design Discussions automation moved this from To Do to Done Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

5 participants