Skip to content

Commit

Permalink
Final things?
Browse files Browse the repository at this point in the history
  • Loading branch information
1ozturkbe committed Sep 17, 2019
1 parent 52c735b commit 2d47112
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion robust/feasibility_plots/plot_feasibilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ def plot_uncertainty_set(ax):
axes[1].set_ylabel(y)

fig.suptitle("%s vs %s feasibility space" % (x, y))
plt.show()
plt.show(block=False)
10 changes: 9 additions & 1 deletion robust/testing/t_two_term_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from gpkit.tests.helpers import run_tests

from robust.twoterm_approximation import TwoTermApproximation
from robust.testing.models import gp_test_model
from robust.testing.models import gp_test_model, sp_test_model
from robust.twoterm_approximation import TwoTermApproximation

class TestTwoTermApproximation(unittest.TestCase):
def test_equivalent_twoterm_model(self):
Expand All @@ -19,6 +20,13 @@ def test_equivalent_twoterm_model(self):
twoterm_gpmodel = Model(gpmodel.cost, [equivalent_constraints], gpmodel.substitutions)
self.assertAlmostEqual(gpmodel.solve(verbosity=0)['cost'],twoterm_gpmodel.solve(verbosity=0)['cost'])

# def test_two_term_approx(self):
# m = gp_test_model()
# settings = {}
# tta = [TwoTermApproximation(i.as_posyslt1()[0], {}) for i in m.flat(constraintsets=False)]
# tta_smart = [TwoTermApproximation(i.as_posyslt1()[0],
# {'smartTwoTermChoose': True}) for i in m.flat(constraintsets=False)]

def test_check_if_permutation_exists(self):
for _ in range(10):
number_of_monomials = int(np.random.rand()*15) + 3
Expand Down

0 comments on commit 2d47112

Please sign in to comment.