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 ...@@ -76,6 +76,11 @@ class TestProblem(ControlTreeMixin, ModelicaMixin, CollocatedIntegratedOptimizat
# Do # Do
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestControlTreeMixin1(TestCase): class TestControlTreeMixin1(TestCase):
@property @property
...@@ -200,6 +205,11 @@ class TestProblemDijkverruiming(ControlTreeMixin, ModelicaMixin, CollocatedInteg ...@@ -200,6 +205,11 @@ class TestProblemDijkverruiming(ControlTreeMixin, ModelicaMixin, CollocatedInteg
# Do # Do
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestDijkverruiming(TestCase): class TestDijkverruiming(TestCase):
def setUp(self): def setUp(self):
...@@ -220,7 +230,7 @@ class TestDijkverruiming(TestCase): ...@@ -220,7 +230,7 @@ class TestDijkverruiming(TestCase):
self.assertTrue(repr(v[0][1]) != repr(v[5][1])) self.assertTrue(repr(v[0][1]) != repr(v[5][1]))
for ensemble_member in range(5, 12): for ensemble_member in range(5, 12):
self.assertTrue(repr(v[5][1]) == repr(v[ensemble_member][1])) self.assertTrue(repr(v[5][1]) == repr(v[ensemble_member][1]))
# t = 0.5 # t = 0.5
for ensemble_member in range(0, 2): for ensemble_member in range(0, 2):
self.assertTrue(repr(v[0][2]) == repr(v[ensemble_member][2])) self.assertTrue(repr(v[0][2]) == repr(v[ensemble_member][2]))
......
...@@ -40,6 +40,11 @@ class TestProblem(CSVMixin, ModelicaMixin, CollocatedIntegratedOptimizationProbl ...@@ -40,6 +40,11 @@ class TestProblem(CSVMixin, ModelicaMixin, CollocatedIntegratedOptimizationProbl
# No additional constraints # No additional constraints
return [] return []
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestProblemLookup(CSVLookupTableMixin, TestProblem): class TestProblemLookup(CSVLookupTableMixin, TestProblem):
......
...@@ -48,6 +48,11 @@ class TestProblem(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegratedOptim ...@@ -48,6 +48,11 @@ class TestProblem(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegratedOptim
# Do nothing # Do nothing
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestGoal1(Goal): class TestGoal1(Goal):
...@@ -266,6 +271,11 @@ class TestProblemPathGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegr ...@@ -266,6 +271,11 @@ class TestProblemPathGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegr
def path_goals(self): def path_goals(self):
return [PathGoal1(), PathGoal2(), PathGoal3(), PathGoal4(), PathGoal5()] 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): class TestGoalProgrammingPathGoals(TestCase):
...@@ -438,6 +448,12 @@ class TestProblemPathGoalsSmoothing(GoalProgrammingMixin, ModelicaMixin, Colloca ...@@ -438,6 +448,12 @@ class TestProblemPathGoalsSmoothing(GoalProgrammingMixin, ModelicaMixin, Colloca
return [PathGoal1(), PathGoal2(), PathGoalSmoothing()] return [PathGoal1(), PathGoal2(), PathGoalSmoothing()]
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestGoalProgrammingSmoothing(TestCase): class TestGoalProgrammingSmoothing(TestCase):
def setUp(self): def setUp(self):
...@@ -506,6 +522,11 @@ class TestProblemStateGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedInteg ...@@ -506,6 +522,11 @@ class TestProblemStateGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedInteg
# Do nothing # Do nothing
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestGoalProgrammingStateGoals(TestCase): class TestGoalProgrammingStateGoals(TestCase):
......
...@@ -56,6 +56,11 @@ class HybridShootingTestProblem(ModelicaMixin, CollocatedIntegratedOptimizationP ...@@ -56,6 +56,11 @@ class HybridShootingTestProblem(ModelicaMixin, CollocatedIntegratedOptimizationP
# Do # Do
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestHybridShooting(TestCase): class TestHybridShooting(TestCase):
......
...@@ -58,6 +58,11 @@ class TestProblem(ModelicaMixin, CollocatedIntegratedOptimizationProblem): ...@@ -58,6 +58,11 @@ class TestProblem(ModelicaMixin, CollocatedIntegratedOptimizationProblem):
# Do # Do
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestProblemNonConvex(TestProblem): class TestProblemNonConvex(TestProblem):
...@@ -164,6 +169,11 @@ class TestProblemAlgebraic(ModelicaMixin, CollocatedIntegratedOptimizationProble ...@@ -164,6 +169,11 @@ class TestProblemAlgebraic(ModelicaMixin, CollocatedIntegratedOptimizationProble
# Do # Do
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestProblemMixedInteger(ModelicaMixin, CollocatedIntegratedOptimizationProblem): class TestProblemMixedInteger(ModelicaMixin, CollocatedIntegratedOptimizationProblem):
...@@ -194,6 +204,11 @@ class TestProblemMixedInteger(ModelicaMixin, CollocatedIntegratedOptimizationPro ...@@ -194,6 +204,11 @@ class TestProblemMixedInteger(ModelicaMixin, CollocatedIntegratedOptimizationPro
# Do # Do
pass pass
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestModelicaMixin(TestCase): class TestModelicaMixin(TestCase):
...@@ -238,7 +253,7 @@ class TestModelicaMixin(TestCase): ...@@ -238,7 +253,7 @@ class TestModelicaMixin(TestCase):
def test_multiple_states(self): def test_multiple_states(self):
self.assertAlmostEqual(self.results['w'][0], 0.0, self.tolerance) self.assertAlmostEqual(self.results['w'][0], 0.0, self.tolerance)
self.assertAlmostEqual(self.results['w'][-1], 0.5917, 1e-4) self.assertAlmostEqual(self.results['w'][-1], 0.5917, 1e-4)
@expectedFailure @expectedFailure
def test_states_in(self): def test_states_in(self):
states = list(self.problem.states_in('x', 0.05, 0.95)) states = list(self.problem.states_in('x', 0.05, 0.95))
......
...@@ -38,6 +38,11 @@ class TestProblem(PIMixin, ModelicaMixin, CollocatedIntegratedOptimizationProble ...@@ -38,6 +38,11 @@ class TestProblem(PIMixin, ModelicaMixin, CollocatedIntegratedOptimizationProble
# No additional constraints # No additional constraints
return [] return []
def compiler_options(self):
compiler_options = super().compiler_options()
compiler_options['cache'] = False
return compiler_options
class TestPIMixin(TestCase): 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