-
Notifications
You must be signed in to change notification settings - Fork 525
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
Calling del_component
on a ComponentData deletes the parent component
#3435
Comments
What would you expect the behavior to be? I could see (at least) two reasonable options:
...If we make a change, I think I would prefer the second option. BTW: you can avoid this by always using
|
I would vote for either 1 (where when x[3] is the last VarData, x stays on the Block but is empty) or 2. I think 3 is mean because the distinction between Component and ComponentData is subtle in this case. We should also probably document somewhere that |
(The other surprising thing about this is that I'm very surprised we don't hit this mistake in the FME tests...) |
Per the dev call:
|
Summary
Calling
del_component
on a ComponentData (at least forConstraint
andVar
) deletes the entire parent component.Steps to reproduce the issue
This script:
Produces this output:
Error Message
No error--we're turfing the entire IndexedComponent silently.
Information on your system
Pyomo version: main
Python version: 3.11
Operating system: linux
How Pyomo was installed (PyPI, conda, source): source
Solver (if applicable): NA
The text was updated successfully, but these errors were encountered: