Commit 32b2014a authored by juga's avatar juga
Browse files

Return bw in kb if not scaled

parent 514671ef
......@@ -359,13 +359,22 @@ class V3BWFile(object):
bw_lines = [V3BWLine.from_results(results[fp]) for fp in results]
bw_lines = sorted(bw_lines, key=lambda d:, reverse=True)
if scale_constant:
if scale_constant is not None:
bw_lines = cls.bw_sbws_scale(bw_lines, scale_constant)
cls.warn_if_not_accurate_enough(bw_lines, scale_constant)
bw_lines = cls.bw_kb(bw_lines)
header = V3BWHeader.from_results(results, state_fpath)
f = cls(header, bw_lines)
return f
def bw_kb(bw_lines, reverse=False):
bw_lines_scaled = copy.deepcopy(bw_lines)
for l in bw_lines_scaled: = max(round( / 1000), 1)
return sorted(bw_lines_scaled, key=lambda x:, reverse=reverse)
def bw_sbws_scale(bw_lines, scale_constant=SCALE_CONSTANT,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment