Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre Donat-Bouillud
audio-adaptive-scheduling
Commits
aefd826b
Commit
aefd826b
authored
May 13, 2019
by
Pierre Donat-Bouillud
Browse files
Correctly retrieve costs and name the graphs in the csv
parent
0a358731
Pipeline
#986
passed with stage
in 2 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pipeline.py
View file @
aefd826b
...
...
@@ -95,10 +95,6 @@ def get_costs(csvname):
nb_rows
+=
1
return
total
/
float
(
nb_rows
),
total
def
execute_graph
(
graph
):
tqdm
.
write
(
"Executing graph "
+
graph
)
subprocess
.
run
([
graph_exec
,
"-m"
,
"-b"
,
"-c"
,
"10000"
,
graph
],
check
=
True
)
def
get_exec_times
(
graph
):
# Get execution times for reports (-m option)
basename
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
graph
))
...
...
@@ -108,6 +104,11 @@ def get_exec_times(graph):
tqdm
.
write
(
"Retrieving monitoring info from "
+
csvfile
)
return
get_costs
(
csvfile
)
def
execute_graph
(
graph
):
tqdm
.
write
(
"Executing graph "
+
graph
)
subprocess
.
run
([
graph_exec
,
"-m"
,
"-b"
,
"-c"
,
"10000"
,
graph
],
check
=
True
)
return
get_exec_times
(
graph
)
def
compare_audio_files
(
audiofiles
):
audiofiles
.
sort
()
# Number 0 is always the non-degraded file
non_degraded
=
audiofiles
.
pop
(
0
)
...
...
@@ -289,6 +290,8 @@ def process_all_graphs(nb_nodes, dirname, random=False, from_graphs=False):
print
(
nb_errors
,
" graphs were discarded due to execution errors"
)
return
results
def
graph_number
(
name
):
return
int
(
name
.
rsplit
(
"-"
,
maxsplit
=
1
)[
1
])
def
results_to_csv
(
graphname
,
qualities
,
costs
):
fieldnames
=
[
"Name"
,
"Quality"
,
"Cost"
,
"Total"
]
...
...
@@ -298,7 +301,7 @@ def results_to_csv(graphname, qualities, costs):
writer
.
writeheader
()
#Get cost original graph
name
=
list
(
sorted
(
costs
.
keys
()))[
0
]
result
[
"Name"
]
=
name
result
[
"Name"
]
=
graph_number
(
name
)
cost
,
total
=
costs
[
name
]
result
[
"Quality"
]
=
1.0
result
[
"Cost"
]
=
cost
...
...
@@ -306,6 +309,7 @@ def results_to_csv(graphname, qualities, costs):
writer
.
writerow
(
result
)
for
graph
in
qualities
.
keys
():
result
=
{}
result
[
"Name"
]
=
graph_number
(
graph
)
result
[
"Quality"
]
=
qualities
[
graph
]
cost
,
total
=
costs
[
graph
]
result
[
"Cost"
]
=
cost
...
...
Write
Preview
Supports
Markdown
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