Skip to content

Commit

Permalink
Revert "modify tests so the fail on main"
Browse files Browse the repository at this point in the history
This reverts commit 0b4d16b.
  • Loading branch information
bknueven committed Jun 27, 2024
1 parent 9ca3928 commit 29e0395
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1846,15 +1846,14 @@ def test_scaling_pyomo_model_only(self):
)
m.obj = pyo.Objective(expr=(m.egb.outputs['Pout'] - 20) ** 2)
m.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.egb.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
# m.scaling_factor[m.obj] = 0.1 # scale the objective
m.egb.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.egb.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.egb.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.egb.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.egb.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.egb.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.egb.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
# m.scaling_factor[m.hin] = 1.8
m.scaling_factor[m.hout] = 1.9
# m.scaling_factor[m.incon] = 2.1
Expand Down Expand Up @@ -1972,15 +1971,14 @@ def test_scaling_pyomo_model_and_greybox(self):
)
m.obj = pyo.Objective(expr=(m.egb.outputs['Pout'] - 20) ** 2)
m.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.egb.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
# m.scaling_factor[m.obj] = 0.1 # scale the objective
m.egb.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.egb.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.egb.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.egb.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.egb.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.egb.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.egb.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
# m.scaling_factor[m.hin] = 1.8
m.scaling_factor[m.hout] = 1.9
# m.scaling_factor[m.incon] = 2.1
Expand Down Expand Up @@ -2065,15 +2063,14 @@ def test_external_greybox_solve_scaling(self):
)

m.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.egb.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.scaling_factor[m.obj] = 0.1 # scale the objective
m.egb.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.egb.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.egb.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.egb.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.egb.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.egb.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.egb.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.mu] = 1.9
m.scaling_factor[m.pincon] = 2.2

Expand Down
60 changes: 28 additions & 32 deletions pyomo/contrib/pynumero/interfaces/tests/test_pyomo_grey_box_nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,15 +956,14 @@ def test_scaling_pyomo_model_only(self):
)
m.obj = pyo.Objective(expr=(m.egb.outputs['Pout'] - 20) ** 2)
m.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.egb.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
# m.scaling_factor[m.obj] = 0.1 # scale the objective
m.egb.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.egb.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.egb.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.egb.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.egb.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.egb.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.egb.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
# m.scaling_factor[m.hin] = 1.8
m.scaling_factor[m.hout] = 1.9
# m.scaling_factor[m.incon] = 2.1
Expand Down Expand Up @@ -2268,15 +2267,14 @@ def test_scaling_pyomo_model_only(self):
)
m.obj = pyo.Objective(expr=(m.egb.outputs['Pout'] - 20) ** 2)
m.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.egb.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
# m.scaling_factor[m.obj] = 0.1 # scale the objective
m.egb.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.egb.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.egb.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.egb.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.egb.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.egb.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.egb.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
# m.scaling_factor[m.hin] = 1.8
m.scaling_factor[m.hout] = 1.9
# m.scaling_factor[m.incon] = 2.1
Expand Down Expand Up @@ -2394,15 +2392,14 @@ def test_scaling_pyomo_model_and_greybox(self):
)
m.obj = pyo.Objective(expr=(m.egb.outputs['Pout'] - 20) ** 2)
m.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.egb.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
# m.scaling_factor[m.obj] = 0.1 # scale the objective
m.egb.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.egb.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.egb.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.egb.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.egb.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.egb.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.egb.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
# m.scaling_factor[m.hin] = 1.8
m.scaling_factor[m.hout] = 1.9
# m.scaling_factor[m.incon] = 2.1
Expand Down Expand Up @@ -2487,15 +2484,14 @@ def test_external_greybox_solve_scaling(self):
)

m.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.egb.scaling_factor = pyo.Suffix(direction=pyo.Suffix.EXPORT)
m.scaling_factor[m.obj] = 0.1 # scale the objective
m.egb.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.egb.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.egb.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.egb.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.egb.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.egb.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.egb.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.egb.inputs['Pin']] = 1.1 # scale the variable
m.scaling_factor[m.egb.inputs['c']] = 1.2 # scale the variable
m.scaling_factor[m.egb.inputs['F']] = 1.3 # scale the variable
# m.scaling_factor[m.egb.inputs['P1']] = 1.4 # scale the variable
m.scaling_factor[m.egb.inputs['P3']] = 1.5 # scale the variable
m.scaling_factor[m.egb.outputs['P2']] = 1.6 # scale the variable
m.scaling_factor[m.egb.outputs['Pout']] = 1.7 # scale the variable
m.scaling_factor[m.mu] = 1.9
m.scaling_factor[m.pincon] = 2.2

Expand Down

0 comments on commit 29e0395

Please sign in to comment.