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
9ac61cc5
Commit
9ac61cc5
authored
Aug 29, 2018
by
juga
Browse files
Reorder methods in BWV3File
1. magic methods 2. classmethods 3. staticmethods 4. properties 5. methods
parent
992ea07e
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/lib/v3bwfile.py
View file @
9ac61cc5
...
...
@@ -374,6 +374,16 @@ class V3BWFile(object):
return
str
(
self
.
header
)
+
''
.
join
([
str
(
bw_line
)
for
bw_line
in
self
.
bw_lines
])
@
classmethod
def
from_arg_results
(
cls
,
args
,
conf
,
results
):
bw_lines
=
[
V3BWLine
.
from_results
(
results
[
fp
])
for
fp
in
results
]
bw_lines
=
sorted
(
bw_lines
,
key
=
lambda
d
:
d
.
bw
,
reverse
=
True
)
if
args
.
scale
:
bw_lines
=
scale_lines
(
bw_lines
,
args
.
scale_constant
)
header
=
V3BWHeader
.
from_results
(
conf
,
results
)
f
=
cls
(
header
,
bw_lines
)
return
f
@
property
def
total_bw
(
self
):
return
total_bw
(
self
.
bw_lines
)
...
...
@@ -386,16 +396,6 @@ class V3BWFile(object):
def
avg_bw
(
self
):
return
self
.
total_bw
/
self
.
num_lines
@
classmethod
def
from_arg_results
(
cls
,
args
,
conf
,
results
):
bw_lines
=
[
V3BWLine
.
from_results
(
results
[
fp
])
for
fp
in
results
]
bw_lines
=
sorted
(
bw_lines
,
key
=
lambda
d
:
d
.
bw
,
reverse
=
True
)
if
args
.
scale
:
bw_lines
=
scale_lines
(
bw_lines
,
args
.
scale_constant
)
header
=
V3BWHeader
.
from_results
(
conf
,
results
)
f
=
cls
(
header
,
bw_lines
)
return
f
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