Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper-io-latency-eval
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lehrstuhl für Informatik 4 (Systemsoftware)
manycore
emper-io-latency-eval
Commits
93265e73
Commit
93265e73
authored
Mar 1, 2022
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
add more type hints and fail with python exceptions
parent
a8fd0deb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
gen_boxplots.py
+9
-2
9 additions, 2 deletions
gen_boxplots.py
muhq-ma-plots.sh
+1
-1
1 addition, 1 deletion
muhq-ma-plots.sh
summarize.py
+1
-7
1 addition, 7 deletions
summarize.py
with
11 additions
and
10 deletions
gen_boxplots.py
+
9
−
2
View file @
93265e73
...
@@ -2,11 +2,14 @@
...
@@ -2,11 +2,14 @@
"""
generate boxplots from descriptive stats in yaml
"""
"""
generate boxplots from descriptive stats in yaml
"""
import
sys
import
sys
import
typing
as
T
import
yaml
import
yaml
Data
=
dict
[
str
,
T
.
Any
]
def
parse_data
(
stream
):
def
parse_data
(
stream
)
->
T
.
Optional
[
Data
]:
"""
Convert yamls string to dict
"""
"""
Convert yamls string to dict
"""
return
yaml
.
safe_load
(
stream
)
return
yaml
.
safe_load
(
stream
)
...
@@ -49,7 +52,7 @@ PLOT_TEMPLATE = \
...
@@ -49,7 +52,7 @@ PLOT_TEMPLATE = \
"""
"""
def
generate_boxplot
(
data
)
->
str
:
def
generate_boxplot
(
data
:
Data
)
->
str
:
"""
generate a tikzboxplot
"""
"""
generate a tikzboxplot
"""
plots
=
''
plots
=
''
for
variant
,
stats
in
data
.
items
():
for
variant
,
stats
in
data
.
items
():
...
@@ -71,6 +74,10 @@ def main():
...
@@ -71,6 +74,10 @@ def main():
with
open
(
sys
.
argv
[
1
],
'
r
'
,
encoding
=
'
utf-8
'
)
as
yaml_file
:
with
open
(
sys
.
argv
[
1
],
'
r
'
,
encoding
=
'
utf-8
'
)
as
yaml_file
:
data
=
parse_data
(
yaml_file
)
data
=
parse_data
(
yaml_file
)
if
data
is
None
:
print
(
'
No data to plot
'
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
tikz
=
generate_boxplot
(
data
)
tikz
=
generate_boxplot
(
data
)
if
len
(
sys
.
argv
)
>
2
:
if
len
(
sys
.
argv
)
>
2
:
...
...
This diff is collapsed.
Click to expand it.
muhq-ma-plots.sh
+
1
−
1
View file @
93265e73
#!/bin/bash
#!/bin/bash
set
-o
pipefail
set
-
e
o
pipefail
SUM
=
./summarize.py
SUM
=
./summarize.py
PLOT
=
./gen_boxplots.py
PLOT
=
./gen_boxplots.py
...
...
This diff is collapsed.
Click to expand it.
summarize.py
+
1
−
7
View file @
93265e73
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
"""
Collect and summarize evaluation results
"""
"""
Collect and summarize evaluation results
"""
import
argparse
import
argparse
import
os
import
sys
import
sys
import
typing
as
T
import
typing
as
T
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -15,13 +14,8 @@ Measurements = list[int]
...
@@ -15,13 +14,8 @@ Measurements = list[int]
Data
=
dict
[
Variant
,
Measurements
]
Data
=
dict
[
Variant
,
Measurements
]
def
collect
(
result_dir
)
->
T
.
Optional
[
Data
]
:
def
collect
(
result_dir
)
->
Data
:
"""
Collect the data in result_dir and return calculated averages
"""
"""
Collect the data in result_dir and return calculated averages
"""
if
not
result_dir
or
not
os
.
path
.
exists
(
result_dir
)
or
not
os
.
path
.
isdir
(
result_dir
):
print
(
f
'
{
result_dir
}
is not a directory
'
)
return
None
result_dir
=
Path
(
result_dir
)
result_dir
=
Path
(
result_dir
)
data
=
{}
data
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment