Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def test_linear_model_tree_uniform(self):
# pretty close to m.x, but we're a bit off because we don't have 0
# as a breakpoint.
0.9833360108369479 * m.x + 0.16663989163052034,
places=7,
places=6,
)

def test_linear_model_tree_random(self):
Expand Down Expand Up @@ -657,7 +657,7 @@ def test_linear_model_tree_random_auto_depth_tree(self):
pwlf._simplices,
[(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8)],
)
self.assertEqual(
self.assertStructuredAlmostEqual(
pwlf._points,
[
(-10,),
Expand All @@ -670,6 +670,7 @@ def test_linear_model_tree_random_auto_depth_tree(self):
(2.15597,),
(10,),
],
places=4,
)
self.assertEqual(len(pwlf._linear_functions), 8)
for i in range(3):
Expand All @@ -680,7 +681,7 @@ def test_linear_model_tree_random_auto_depth_tree(self):
# pretty close to - m.x, but we're a bit off because we don't have 0
# as a breakpoint.
-0.9851979299618323 * m.x + 0.12006477080409184,
places=7,
places=6,
)
for i in range(4, 8):
assertExpressionsEqual(self, pwlf._linear_functions[i](m.x), m.x)
Expand Down
Loading