Commit 455a7f69 authored by juga's avatar juga
Browse files

fix: scaling: Return if there are no measurements

it should not be the case because the measurements come from
successful results, but otherwise it'd throw an exception.
parent e3b4c4ed
...@@ -14,11 +14,13 @@ def bw_filt(bw_measurements): ...@@ -14,11 +14,13 @@ def bw_filt(bw_measurements):
It is the equivalent to Torflow's ``filt_sbw``. It is the equivalent to Torflow's ``filt_sbw``.
``mu`` in this function is the equivalent to Torflow's ``sbw``. ``mu`` in this function is the equivalent to Torflow's ``sbw``.
""" """
mu = 1 # This should never be the case, as the measurements come from successful
if bw_measurements: # results.
# Torflow is rounding to an integer, so is `bw_mean_from_results` in if not bw_measurements:
# `v3bwfile.py` return 1
mu = round(mean(bw_measurements)) # Torflow is rounding to an integer, so is `bw_mean_from_results` in
# `v3bwfile.py`
mu = round(mean(bw_measurements))
bws_gte_mean = list(filter(lambda bw: bw >= mu, bw_measurements)) bws_gte_mean = list(filter(lambda bw: bw >= mu, bw_measurements))
if bws_gte_mean: if bws_gte_mean:
return round(mean(bws_gte_mean)) return round(mean(bws_gte_mean))
......
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