Skip to content

Commit ec73186

Browse files
authored
Merge pull request #3645 from emma58/modernize-relax-integer-vars
Two tiny changes to `core.relax_integer_vars`
2 parents 88940a9 + bee3e61 commit ec73186

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyomo/core/plugins/transform/discrete_vars.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
Constraint,
2929
Objective,
3030
)
31+
from pyomo.core.base.block import SubclassOf
3132
from pyomo.core.util import target_list
3233
from pyomo.gdp import Disjunct
3334
from pyomo.util.vars_from_expressions import get_vars_from_components
@@ -66,7 +67,7 @@ class RelaxIntegerVars(Transformation):
6667
doc="""
6768
This argument should be the reverse transformation token
6869
returned by a previous call to this transformation to transform
69-
fixed disjunctive state in the given model.
70+
fixed discrete state in the given model.
7071
If this argument is specified, this call to the transformation
7172
will reverse what the transformation did in the call that returned
7273
the token. Note that if there are intermediate changes to the model
@@ -116,7 +117,7 @@ def __init__(self):
116117
super().__init__()
117118

118119
def _apply_to(self, model, **kwds):
119-
if not model.ctype in (Block, Disjunct):
120+
if model.ctype not in SubclassOf(Block):
120121
raise ValueError(
121122
"Transformation called on %s of type %s. 'model' "
122123
"must be a ConcreteModel or Block." % (model.name, model.ctype)

0 commit comments

Comments
 (0)