Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
17587098
Commit
17587098
authored
Mar 10, 2020
by
niklas.baumgarten
Browse files
added test
parent
6b971f08
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/test_experiments.py
View file @
17587098
...
...
@@ -25,7 +25,7 @@ class TestExperiments(TestCase):
mpp
.
clean_data
()
class
TestBasics
(
TestExperiments
):
class
Test
Elliptic
Basics
(
TestExperiments
):
def
test_git_repo
(
self
):
self
.
assertEqual
(
mpp
.
check_git_project
(),
0
)
...
...
@@ -37,7 +37,7 @@ class TestBasics(TestExperiments):
class
TestEllipticConvergence
(
TestExperiments
):
def
test_smoothing_experiment
(
self
):
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'
}
...
...
@@ -49,6 +49,27 @@ class TestEllipticConvergence(TestExperiments):
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
TestTransportTransport
(
TestExperiments
):
def
test_run
(
self
):
epsilons
=
[
0.05
,
0.03
,
0.01
,
0.005
]
for
epsilon
in
epsilons
:
kwargs
=
{
'epsilon'
:
epsilon
}
self
.
assertEqual
(
mpp
.
run
(
4
,
config
=
'mlmc_transport'
,
kwargs
=
kwargs
),
0
)
def
test_file_creation
(
self
):
pass
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment