You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can use the return from create_using to create a Block on a model, but I lose the mappings between primal and dual components when I do so. I'm not sure why, but it seems that somehow the private_data data structure is empty in this case?
Traceback (most recent call last):
File "/home/esjohn/src/pyomo/pyomo/core/tests/im_confused.py", line 31, in <module>
dualvar = lp_dual.get_dual_var(m.dualblk, m.inner.c1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/esjohn/src/pyomo/pyomo/core/plugins/transform/lp_dual.py", line 259, in get_dual_var
raise ValueError(
ValueError: It does not appear that Constraint 'inner.c1' is a primal constraint on model 'dualblk'
Information on your system
Pyomo version: main branch
Python version: 3.11
Operating system: linux
How Pyomo was installed (PyPI, conda, source): source
Solver (if applicable):
Summary
I can use the return from
create_using
to create a Block on a model, but I lose the mappings between primal and dual components when I do so. I'm not sure why, but it seems that somehow theprivate_data
data structure is empty in this case?Steps to reproduce the issue
This script looks like it should work:
Error Message
But the transformation can't find the mapping:
Information on your system
Pyomo version: main branch
Python version: 3.11
Operating system: linux
How Pyomo was installed (PyPI, conda, source): source
Solver (if applicable):
Additional information
Replacing the
m.dualblk = Block(...)
line withworks as expected. So the rule construction is at fault.
The text was updated successfully, but these errors were encountered: