Skip to content

Commit

Permalink
HA, she can code... Fixing dumb typos in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
emma58 committed Aug 6, 2024
1 parent 398c468 commit 68b15a5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

from pyomo.common.dependencies import attempt_import, scipy_available
from pyomo.common.dependencies import attempt_import, scipy_available, numpy_available
import pyomo.common.unittest as unittest
from pyomo.contrib.piecewise import PiecewiseLinearFunction
from pyomo.contrib.piecewise.transform.nonlinear_to_pwl import (
Expand Down Expand Up @@ -88,7 +88,7 @@ def check_pw_linear_log_x(self, m, pwlf, x1, x2, x3):
self.assertEqual(len(nonlinear), 1)
self.assertIn(m.cons, nonlinear)

@skipUnless(numpy_available, "Numpy is not available")
@unittest.skipUnless(numpy_available, "Numpy is not available")
def test_log_constraint_uniform_grid(self):
m = self.make_model()

Expand All @@ -112,7 +112,7 @@ def test_log_constraint_uniform_grid(self):
(x1, x2, x3) = 1.0009, 5.5, 9.9991
self.check_pw_linear_log_x(m, pwlf, x1, x2, x3)

@skipUnless(numpy_available, "Numpy is not available")
@unittest.skipUnless(numpy_available, "Numpy is not available")
def test_log_constraint_random_grid(self):
m = self.make_model()

Expand All @@ -139,7 +139,7 @@ def test_log_constraint_random_grid(self):
x3 = 9.556428757689245
self.check_pw_linear_log_x(m, pwlf, x1, x2, x3)

@skipUnless(numpy_available, "Numpy is not available")
@unittest.skipUnless(numpy_available, "Numpy is not available")
def test_do_not_transform_quadratic_constraint(self):
m = self.make_model()
m.quad = Constraint(expr=m.x**2 <= 9)
Expand Down Expand Up @@ -171,7 +171,7 @@ def test_do_not_transform_quadratic_constraint(self):
# neither is the linear one
self.assertTrue(m.lin.active)

@skipUnless(numpy_available, "Numpy is not available")
@unittest.skipUnless(numpy_available, "Numpy is not available")
def test_constraint_target(self):
m = self.make_model()
m.quad = Constraint(expr=m.x**2 <= 9)
Expand Down Expand Up @@ -254,7 +254,7 @@ def test_error_for_non_separable_exceeding_max_dimension(self):
max_dimension=4,
)

@skipUnless(numpy_available, "Numpy is not available")
@unittest.skipUnless(numpy_available, "Numpy is not available")
def test_do_not_additively_decompose_below_min_dimension(self):
m = ConcreteModel()
m.x = Var([0, 1, 2, 3, 4], bounds=(-4, 5))
Expand Down Expand Up @@ -316,7 +316,7 @@ def check_pw_linear_paraboloid(self, m, pwlf, x1, x2, y1, y2):
nonlinear = n_to_pwl.get_transformed_nonlinear_objectives(m)
self.assertEqual(len(nonlinear), 0)

@skipUnless(numpy_available, "Numpy is not available")
@unittest.skipUnless(numpy_available, "Numpy is not available")
def test_paraboloid_objective_uniform_grid(self):
m = self.make_paraboloid_model()

Expand All @@ -343,7 +343,7 @@ def test_paraboloid_objective_uniform_grid(self):

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

@skipUnless(numpy_available, "Numpy is not available")
@unittest.skipUnless(numpy_available, "Numpy is not available")
def test_objective_target(self):
m = self.make_paraboloid_model()

Expand Down

0 comments on commit 68b15a5

Please sign in to comment.