Skip to content

Commit

Permalink
NFC: updating docstring and removing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
emma58 committed Feb 17, 2024
1 parent f12b762 commit fed34ae
Showing 1 changed file with 5 additions and 31 deletions.
36 changes: 5 additions & 31 deletions pyomo/gdp/plugins/hull.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,11 @@ class Hull_Reformulation(GDP_to_MIP_Transformation):
list of blocks and Disjunctions [default: the instance]
The transformation will create a new Block with a unique
name beginning "_pyomo_gdp_hull_reformulation".
The block will have a dictionary "_disaggregatedVarMap:
'srcVar': ComponentMap(<src var>:<disaggregated var>),
'disaggregatedVar': ComponentMap(<disaggregated var>:<src var>)
It will also have a ComponentMap "_bigMConstraintMap":
<disaggregated var>:<bounds constraint>
Last, it will contain an indexed Block named "relaxedDisjuncts",
which will hold the relaxed disjuncts. This block is indexed by
an integer indicating the order in which the disjuncts were relaxed.
Each block has a dictionary "_constraintMap":
name beginning "_pyomo_gdp_hull_reformulation". It will contain an
indexed Block named "relaxedDisjuncts" that will hold the relaxed
disjuncts. This block is indexed by an integer indicating the order
in which the disjuncts were relaxed. Each block has a dictionary
"_constraintMap":
'srcConstraints': ComponentMap(<transformed constraint>:
<src constraint>),
Expand All @@ -108,7 +100,6 @@ class Hull_Reformulation(GDP_to_MIP_Transformation):
The _pyomo_gdp_hull_reformulation block will have a ComponentMap
"_disaggregationConstraintMap":
<src var>:ComponentMap(<srcDisjunction>: <disaggregation constraint>)
"""

CONFIG = cfg.ConfigDict('gdp.hull')
Expand Down Expand Up @@ -244,23 +235,6 @@ def _get_user_defined_local_vars(self, targets):
blk = blk.parent_block()
return user_defined_local_vars

# def _get_local_vars_from_suffixes(self, block, local_var_dict):
# # You can specify suffixes on any block (disjuncts included). This
# # method starts from a Disjunct (presumably) and checks for a LocalVar
# # suffixes going both up and down the tree, adding them into the
# # dictionary that is the second argument.

# # first look beneath where we are (there could be Blocks on this
# # disjunct)
# for b in block.component_data_objects(
# Block, descend_into=Block, active=True, sort=SortComponents.deterministic
# ):
# self._collect_local_vars_from_block(b, local_var_dict)
# # now traverse upwards and get what's above
# while block is not None:
# self._collect_local_vars_from_block(block, local_var_dict)
# block = block.parent_block()

def _apply_to(self, instance, **kwds):
try:
self._apply_to_impl(instance, **kwds)
Expand Down

0 comments on commit fed34ae

Please sign in to comment.