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
a34a2cca
Commit
a34a2cca
authored
Mar 04, 2020
by
niklas.baumgarten
Browse files
small bug fix
parent
31a75c03
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/mlmc_mppy.py
View file @
a34a2cca
...
...
@@ -89,7 +89,7 @@ class MLMCMpp(Mpp):
def
parse_mlmc_table
(
self
,
log_content
):
float_pattern
=
self
.
create_float_pattern
()
columns
=
[
"
eps
"
,
"
value
"
,
"
MLMC cost
"
,
"
MC cost
"
,
"l"
,
"M"
]
columns
=
[
'
eps
'
,
'
value
'
,
'
MLMC cost
'
,
'
MC cost
'
,
'l'
,
'M'
]
df
=
pd
.
DataFrame
(
columns
=
columns
)
ctr
=
0
...
...
@@ -219,8 +219,8 @@ class MLMCMpp(Mpp):
self
.
plot_convergence_table
(
df
,
axes
,
label
)
if
plot_name
is
not
None
:
path
=
self
.
PROJECT_PY_DATA_DIR
+
'Convergence_{}_{}.png'
.
format
(
plot_name
,
self
.
now
)
path
=
self
.
PROJECT_PY_DATA_DIR
+
'
/
Convergence_{}_{}.png'
.
format
(
plot_name
,
self
.
now
)
plt
.
savefig
(
path
)
else
:
plt
.
show
()
...
...
@@ -264,7 +264,7 @@ class MLMCMpp(Mpp):
return
df
def
print_convergence_table
(
self
,
df
=
None
):
self
.
create_convergence_table_from_log
(
df
)
df
=
self
.
create_convergence_table_from_log
(
df
)
self
.
prepare_pd_table
()
print
(
df
)
...
...
@@ -274,10 +274,10 @@ class MLMCMpp(Mpp):
print
(
df
)
def
save_convergence_table
(
self
,
df
=
None
,
table_name
=
None
):
self
.
create_convergence_table_from_log
(
df
)
path
=
self
.
PROJECT_PY_DATA_DIR
+
'Convergence_{}_{}.csv'
.
format
(
table_name
,
self
.
now
)
df
.
to_csv
(
path
)
df_
=
self
.
create_convergence_table_from_log
(
df
)
path
=
self
.
PROJECT_PY_DATA_DIR
+
'
/
Convergence_{}_{}.csv'
.
format
(
table_name
,
self
.
now
)
df
_
.
to_csv
(
path
)
def
save_mlmc_table
(
self
,
df
,
table_name
=
None
):
self
.
create_mlmc_table
(
df
)
...
...
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