Skip to content

Commit

Permalink
apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbybp committed Mar 7, 2024
1 parent 8b66e10 commit 70f225e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions pyomo/util/subsystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


class _ExternalFunctionVisitor(StreamBasedExpressionVisitor):

def __init__(self, descend_into_named_expressions=True):
super().__init__()
self._descend_into_named_expressions = descend_into_named_expressions
Expand Down Expand Up @@ -56,10 +55,10 @@ def exitNode(self, node, data):
def finalizeResult(self, result):
return self._functions

#def enterNode(self, node):
# def enterNode(self, node):
# pass

#def acceptChildResult(self, node, data, child_result, child_idx):
# def acceptChildResult(self, node, data, child_result, child_idx):
# if child_result.__class__ in native_types:
# return False, None
# return child_result.is_expression_type(), None
Expand Down Expand Up @@ -114,6 +113,8 @@ def add_local_external_functions(block):


from pyomo.common.timing import HierarchicalTimer


def create_subsystem_block(
constraints,
variables=None,
Expand Down
4 changes: 2 additions & 2 deletions pyomo/util/tests/test_subsystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ def _make_model_with_external_functions(self, named_expressions=False):
m.subexpr = pyo.Expression(pyo.PositiveIntegers)
subexpr1 = m.subexpr[1] = 2 * m.fermi(m.v1)
subexpr2 = m.subexpr[2] = m.bessel(m.v1) - m.bessel(m.v2)
subexpr3 = m.subexpr[3] = m.subexpr[2] + m.v3 ** 2
subexpr3 = m.subexpr[3] = m.subexpr[2] + m.v3**2
else:
subexpr1 = 2 * m.fermi(m.v1)
subexpr2 = m.bessel(m.v1) - m.bessel(m.v2)
subexpr3 = m.subexpr[2] + m.v3 ** 2
subexpr3 = m.subexpr[2] + m.v3**2
m.con1 = pyo.Constraint(expr=m.v1 == 0.5)
m.con2 = pyo.Constraint(expr=subexpr1 + m.v2**2 - m.v3 == 1.0)
m.con3 = pyo.Constraint(expr=subexpr3 == 2.0)
Expand Down

0 comments on commit 70f225e

Please sign in to comment.