Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
juga
sbws
Commits
bce5f898
Commit
bce5f898
authored
Aug 31, 2018
by
juga
Browse files
Add method to obtain data for plotting
parent
9bc81f48
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/lib/v3bwfile.py
View file @
bce5f898
...
...
@@ -724,6 +724,15 @@ class V3BWFile(object):
def
median_bw
(
self
):
return
median
([
l
.
bw
for
l
in
self
.
bw_lines
])
def
to_plt
(
self
,
attrs
=
[
'bw'
],
sorted_by
=
None
):
"""Return bandwidth data in a format useful for matplotlib.
Used from external tool to plot.
"""
x
=
[
i
for
i
in
range
(
0
,
self
.
num
)]
ys
=
[[
getattr
(
l
,
k
)
for
l
in
self
.
bw_lines
]
for
k
in
attrs
]
return
x
,
ys
,
attrs
def
write
(
self
,
output
):
if
output
==
'/dev/stdout'
:
log
.
info
(
"Writing to stdout is not supported."
)
...
...
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