Skip to content

Commit

Permalink
Merge branch 'main' into suffix-finder-context
Browse files Browse the repository at this point in the history
  • Loading branch information
blnicho authored Aug 15, 2024
2 parents c048b55 + 123c465 commit c810bc3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 deletions.
2 changes: 0 additions & 2 deletions pyomo/contrib/cp/interval_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ def _getitem_when_not_present(self, index):

class ScalarIntervalVar(IntervalVarData, IntervalVar):
def __init__(self, *args, **kwds):
self._suppress_ctypes = set()

IntervalVarData.__init__(self, self)
IntervalVar.__init__(self, *args, **kwds)
self._data[None] = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ def main():
obj, theta, cov = pest.theta_est(calc_cov=True, cov_n=17)
print(obj)
print(theta)


if __name__ == "__main__":
main()
2 changes: 0 additions & 2 deletions pyomo/contrib/piecewise/piecewise_linear_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,6 @@ class ScalarPiecewiseLinearFunction(
PiecewiseLinearFunctionData, PiecewiseLinearFunction
):
def __init__(self, *args, **kwds):
self._suppress_ctypes = set()

PiecewiseLinearFunctionData.__init__(self, self)
PiecewiseLinearFunction.__init__(self, *args, **kwds)
self._data[None] = self
Expand Down
12 changes: 0 additions & 12 deletions pyomo/core/base/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,13 +960,8 @@ def add_component(self, name, val):
% (name, type(val), self.name, type(getattr(self, name)))
)
#
# Skip the add_component() logic if this is a
# component type that is suppressed.
#
_component = self.parent_component()
_type = val.ctype
if _type in _component._suppress_ctypes:
return
#
# Raise an exception if the component already has a parent.
#
Expand Down Expand Up @@ -1048,12 +1043,6 @@ def add_component(self, name, val):
else:
self._ctypes[_type] = [_new_idx, _new_idx, 1]
#
# Propagate properties to sub-blocks:
# suppressed ctypes
#
if _type is Block:
val._suppress_ctypes |= _component._suppress_ctypes
#
# Error, for disabled support implicit rule names
#
if '_rule' in val.__dict__ and val._rule is None:
Expand Down Expand Up @@ -2029,7 +2018,6 @@ def __init__(

def __init__(self, *args, **kwargs):
"""Constructor"""
self._suppress_ctypes = set()
_rule = kwargs.pop('rule', None)
_options = kwargs.pop('options', None)
# As concrete applies to the Block at declaration time, we will
Expand Down
6 changes: 0 additions & 6 deletions pyomo/gdp/disjunct.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,6 @@ def _activate_without_unfixing_indicator(self):

class ScalarDisjunct(DisjunctData, Disjunct):
def __init__(self, *args, **kwds):
## FIXME: This is a HACK to get around a chicken-and-egg issue
## where BlockData creates the indicator_var *before*
## Block.__init__ declares the _defer_construction flag.
self._defer_construction = True
self._suppress_ctypes = set()

DisjunctData.__init__(self, self)
Disjunct.__init__(self, *args, **kwds)
self._data[None] = self
Expand Down

0 comments on commit c810bc3

Please sign in to comment.