Skip to content

Commit 061e46f

Browse files
committed
update tests
1 parent f5fe237 commit 061e46f

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def test_log_constraint_uniform_grid(self):
116116
self.assertEqual(len(pwlf), 1)
117117
pwlf = pwlf[0]
118118

119-
points = [(1.0009,), (5.5,), (9.9991,)]
120-
x1, x2, x3 = 1.0009, 5.5, 9.9991
119+
points = [(1,), (5.5,), (10,)]
120+
x1, x2, x3 = 1, 5.5, 10
121121
self.check_pw_linear_log_x(m, pwlf, x1, x2, x3)
122122

123123
@unittest.skipUnless(numpy_available, "Numpy is not available")
@@ -142,8 +142,8 @@ def test_clone_transformed_model(self):
142142
self.assertEqual(len(pwlf), 1)
143143
pwlf = pwlf[0]
144144

145-
points = [(1.0009,), (5.5,), (9.9991,)]
146-
x1, x2, x3 = 1.0009, 5.5, 9.9991
145+
points = [(1,), (5.5,), (10,)]
146+
x1, x2, x3 = 1, 5.5, 10
147147

148148
self.check_pw_linear_log_x(twin, pwlf, x1, x2, x3)
149149

@@ -197,8 +197,8 @@ def test_do_not_transform_quadratic_constraint(self):
197197
self.assertEqual(len(pwlf), 1)
198198
pwlf = pwlf[0]
199199

200-
points = [(1.0009,), (5.5,), (9.9991,)]
201-
x1, x2, x3 = 1.0009, 5.5, 9.9991
200+
points = [(1,), (5.5,), (10,)]
201+
x1, x2, x3 = 1, 5.5, 10
202202
self.check_pw_linear_log_x(m, pwlf, x1, x2, x3)
203203

204204
# quad is not
@@ -228,8 +228,8 @@ def test_constraint_target(self):
228228
self.assertEqual(len(pwlf), 1)
229229
pwlf = pwlf[0]
230230

231-
points = [(1.0009,), (5.5,), (9.9991,)]
232-
x1, x2, x3 = 1.0009, 5.5, 9.9991
231+
points = [(1,), (5.5,), (10,)]
232+
x1, x2, x3 = 1, 5.5, 10
233233
self.check_pw_linear_log_x(m, pwlf, x1, x2, x3)
234234

235235
# quad is not
@@ -501,10 +501,10 @@ def test_paraboloid_objective_uniform_grid(self):
501501
self.assertEqual(len(pwlf), 1)
502502
pwlf = pwlf[0]
503503

504-
x1 = 0.00030000000000000003
505-
x2 = 2.9997
506-
y1 = 1.0006
507-
y2 = 6.9994
504+
x1 = 0
505+
x2 = 3
506+
y1 = 1
507+
y2 = 7
508508

509509
self.check_pw_linear_paraboloid(m, pwlf, x1, x2, y1, y2)
510510

@@ -531,10 +531,10 @@ def test_multivariate_clone(self):
531531
self.assertEqual(len(pwlf), 1)
532532
pwlf = pwlf[0]
533533

534-
x1 = 0.00030000000000000003
535-
x2 = 2.9997
536-
y1 = 1.0006
537-
y2 = 6.9994
534+
x1 = 0
535+
x2 = 3
536+
y1 = 1
537+
y2 = 7
538538

539539
self.check_pw_linear_paraboloid(twin, pwlf, x1, x2, y1, y2)
540540

@@ -562,10 +562,10 @@ def test_objective_target(self):
562562
self.assertEqual(len(pwlf), 1)
563563
pwlf = pwlf[0]
564564

565-
x1 = 0.00030000000000000003
566-
x2 = 2.9997
567-
y1 = 1.0006
568-
y2 = 6.9994
565+
x1 = 0
566+
x2 = 3
567+
y1 = 1
568+
y2 = 7
569569

570570
self.check_pw_linear_paraboloid(m, pwlf, x1, x2, y1, y2)
571571

0 commit comments

Comments
 (0)