Commit 03725fff authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

updated tests

parent d04306ec
Pipeline #76018 failed with stages
in 71 minutes and 40 seconds
......@@ -36,41 +36,51 @@ class TestEllipticBasics(TestExperiments):
self.assertEqual(mpp.run(4, config='mlmc_elliptic'), 0)
class TestEllipticConvergence(TestExperiments):
def test_smoothing_experiment_benchmark(self):
self.assertTrue(not os.listdir(mpp.PROJECT_PY_DATA_DIR))
# class TestEllipticConvergence(TestExperiments):
# def test_smoothing_experiment_benchmark(self):
# self.assertTrue(not os.listdir(mpp.PROJECT_PY_DATA_DIR))
# mpp.mute = False
# kwargs = {'Experiment': 'ConvergenceTest', 'initLevels': '3, 4, 5, 6, 7, 8, 9'}
# smoothings = [1.0, 1.4, 1.8]
# for smoothing in smoothings:
# kwargs['smoothing'] = smoothing
# self.assertEqual(mpp.run(4, config='mlmc_elliptic', kwargs=kwargs), 0)
# mpp.show_convergence_table(plot_name='Test')
# mpp.save_convergence_table(table_name='Test')
# self.assertEqual(len(os.listdir(mpp.PROJECT_PY_DATA_DIR)), 6)
#
# def test_smoothing_experiment_small(self):
# mpp.mute = False
# kwargs = {'Experiment': 'ConvergenceTest', 'initLevels': '3, 4, 5, 6'}
# smoothings = [1.4, 1.8]
# for smoothing in smoothings:
# kwargs['smoothing'] = smoothing
# self.assertEqual(mpp.run(4, config='mlmc_elliptic', kwargs=kwargs), 0)
# mpp.show_convergence_table(plot_name='Test')
# mpp.save_convergence_table(table_name='Test')
# self.assertEqual(len(os.listdir(mpp.PROJECT_PY_DATA_DIR)), 6)
class TestEllipticExperiment(TestExperiments):
def test_experiment(self):
mpp.mute = False
kwargs = {'Experiment': 'ConvergenceTest', 'initLevels': '3, 4, 5, 6, 7, 8, 9'}
smoothings = [1.0, 1.4, 1.8]
for smoothing in smoothings:
kwargs['smoothing'] = smoothing
kwargs = {'Experiment': 'MLMCExperiment'}
epsilons = [0.01, 0.005, 0.03, 0.001]
for epsilon in epsilons:
kwargs['epsilon'] = epsilon
self.assertEqual(mpp.run(4, config='mlmc_elliptic', kwargs=kwargs), 0)
mpp.show_convergence_table(plot_name='Test')
mpp.save_convergence_table(table_name='Test')
self.assertEqual(len(os.listdir(mpp.PROJECT_PY_DATA_DIR)), 6)
def test_smoothing_experiment_small(self):
mpp.mute = False
kwargs = {'Experiment': 'ConvergenceTest', 'initLevels': '3, 4, 5, 6'}
smoothings = [1.4, 1.8]
for smoothing in smoothings:
kwargs['smoothing'] = smoothing
self.assertEqual(mpp.run(4, config='mlmc_elliptic', kwargs=kwargs), 0)
mpp.show_convergence_table(plot_name='Test')
mpp.save_convergence_table(table_name='Test')
self.assertEqual(len(os.listdir(mpp.PROJECT_PY_DATA_DIR)), 6)
class TestTransportBasics(TestExperiments):
def test_problems(self):
problems = [#'StochasticPollution1D',
#'DeterministicPollution1D',
'StochasticPollution2D',
'DeterministicPollution2D',
'StochasticPollutionCosHat2D',
'DeterministicPollutionCosHat2D',
'StochasticPollutionMollifiedBar2D',
'DeterministicPollutionMollifiedBar2D']
problems = [ # 'StochasticPollution1D',
# 'DeterministicPollution1D',
'StochasticPollution2D',
'DeterministicPollution2D',
'StochasticPollutionCosHat2D',
'DeterministicPollutionCosHat2D',
'StochasticPollutionMollifiedBar2D',
'DeterministicPollutionMollifiedBar2D']
for problem in problems:
kwargs = {'Problem': problem}
self.assertEqual(mpp.run(4, config='mlmc_transport', kwargs=kwargs), 0)
......@@ -78,5 +88,6 @@ class TestTransportBasics(TestExperiments):
def test_file_creation(self):
pass
if __name__ == '__main__':
main()
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