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
When I change the domain of an IndexedVar, it changes all the existing VarDatas, but when I add a new one, it has the old domain.
Steps to reproduce the issue
from pyomo.environ import *
m = ConcreteModel()
m.x = Var(Any, domain=NonNegativeIntegers, dense=False)
m.x[1]
m.x[2]
# This is fine:
m.pprint()
# Never mind!
m.x.domain= NonNegativeReals
# Fine
m.pprint()
m.x[3]
# Whoops, we didn't update the rule!
m.pprint()
Summary
When I change the domain of an
IndexedVar
, it changes all the existing VarDatas, but when I add a new one, it has the old domain.Steps to reproduce the issue
Gives this output:
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):
The text was updated successfully, but these errors were encountered: