Skip to content

Commit

Permalink
Replace domain comparison by type(domain) comparison
Browse files Browse the repository at this point in the history
Fixes Pyomo#995
  • Loading branch information
RomeoV committed May 2, 2019
1 parent 41ef9ce commit 4b97240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyomo/core/plugins/transform/discrete_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _apply_to(self, model, **kwds):
_base_model_vars = model.component_data_objects(
Var, active=True, descend_into=True )
for var in _base_model_vars:
if var.domain in _discrete_relaxation_map and not var.is_fixed():
if any(type(var.domain) is type(domain) for domain in _discrete_relaxation_map) and not var.is_fixed():
fixed_vars.append(var)
var.fix()
model._fixed_discrete_vars = Suffix(direction=Suffix.LOCAL)
Expand Down

0 comments on commit 4b97240

Please sign in to comment.