Skip to content

Commit

Permalink
Hack around Pyomo#3045 by just ignoring things that don't have a ctyp…
Browse files Browse the repository at this point in the history
…e when I collect components in the docplex writer
  • Loading branch information
emma58 committed Dec 1, 2023
1 parent c2475d8 commit 6114a3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyomo/contrib/cp/repn/docplex_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,9 @@ def collect_valid_components(model, active=True, sort=None, valid=set(), targets
unrecognized = {}
components = {k: [] for k in targets}
for obj in model.component_data_objects(active=True, descend_into=True, sort=sort):
# HACK around #3045
if not hasattr(obj, 'ctype'):
continue
ctype = obj.ctype
if ctype in components:
components[ctype].append(obj)
Expand Down

0 comments on commit 6114a3c

Please sign in to comment.