Commit f0cceab6 authored by Tjerk Vreeken's avatar Tjerk Vreeken

Do not cache test models

parent 64d3fa62
......@@ -76,6 +76,11 @@ class TestProblem(ControlTreeMixin, ModelicaMixin, CollocatedIntegratedOptimizat
# Do
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestControlTreeMixin1(TestCase):
@property
......@@ -200,6 +205,11 @@ class TestProblemDijkverruiming(ControlTreeMixin, ModelicaMixin, CollocatedInteg
# Do
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestDijkverruiming(TestCase):
def setUp(self):
......@@ -220,7 +230,7 @@ class TestDijkverruiming(TestCase):
self.assertTrue(repr(v[0][1]) != repr(v[5][1]))
for ensemble_member in range(5, 12):
self.assertTrue(repr(v[5][1]) == repr(v[ensemble_member][1]))
# t = 0.5
for ensemble_member in range(0, 2):
self.assertTrue(repr(v[0][2]) == repr(v[ensemble_member][2]))
......
......@@ -40,6 +40,11 @@ class TestProblem(CSVMixin, ModelicaMixin, CollocatedIntegratedOptimizationProbl
# No additional constraints
return []
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestProblemLookup(CSVLookupTableMixin, TestProblem):
......
......@@ -48,6 +48,11 @@ class TestProblem(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegratedOptim
# Do nothing
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestGoal1(Goal):
......@@ -266,6 +271,11 @@ class TestProblemPathGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegr
def path_goals(self):
return [PathGoal1(), PathGoal2(), PathGoal3(), PathGoal4(), PathGoal5()]
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestGoalProgrammingPathGoals(TestCase):
......@@ -438,6 +448,12 @@ class TestProblemPathGoalsSmoothing(GoalProgrammingMixin, ModelicaMixin, Colloca
return [PathGoal1(), PathGoal2(), PathGoalSmoothing()]
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestGoalProgrammingSmoothing(TestCase):
def setUp(self):
......@@ -506,6 +522,11 @@ class TestProblemStateGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedInteg
# Do nothing
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestGoalProgrammingStateGoals(TestCase):
......
......@@ -56,6 +56,11 @@ class HybridShootingTestProblem(ModelicaMixin, CollocatedIntegratedOptimizationP
# Do
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestHybridShooting(TestCase):
......
......@@ -58,6 +58,11 @@ class TestProblem(ModelicaMixin, CollocatedIntegratedOptimizationProblem):
# Do
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestProblemNonConvex(TestProblem):
......@@ -164,6 +169,11 @@ class TestProblemAlgebraic(ModelicaMixin, CollocatedIntegratedOptimizationProble
# Do
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestProblemMixedInteger(ModelicaMixin, CollocatedIntegratedOptimizationProblem):
......@@ -194,6 +204,11 @@ class TestProblemMixedInteger(ModelicaMixin, CollocatedIntegratedOptimizationPro
# Do
pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestModelicaMixin(TestCase):
......@@ -238,7 +253,7 @@ class TestModelicaMixin(TestCase):
def test_multiple_states(self):
self.assertAlmostEqual(self.results['w'][0], 0.0, self.tolerance)
self.assertAlmostEqual(self.results['w'][-1], 0.5917, 1e-4)
@expectedFailure
def test_states_in(self):
states = list(self.problem.states_in('x', 0.05, 0.95))
......
......@@ -38,6 +38,11 @@ class TestProblem(PIMixin, ModelicaMixin, CollocatedIntegratedOptimizationProble
# No additional constraints
return []
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestPIMixin(TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment