Skip to content
Snippets Groups Projects
Commit 9ac61cc5 authored by juga's avatar juga
Browse files

Reorder methods in BWV3File

1. magic methods
2. classmethods
3. staticmethods
4. properties
5. methods
parent 992ea07e
Branches
Tags
No related merge requests found
......@@ -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.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment