Skip to content

Commit

Permalink
plotters: Use inclusive comparisons when cutting off data points
Browse files Browse the repository at this point in the history
When drawing CDF plots, the 'cutoff' parameter can exclude some data points
from the plot, typically to exclude the latency measurements from the idle
part of the test. When latency rises very sharply after the bandwidth tests
start, this can cut off the last data point of the 'average' data series
before the latency goes up, which leads to some odd-looking CDFs where the
'average' series doesn't go to zero while the other series do.

Fix this by making the comparison for cutoff inclusive; i.e., when cutting
off data points at the start of the test, include all points that are <=
the cutoff value, instead of <.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
  • Loading branch information
tohojo committed Apr 21, 2020
1 parent d06e0b6 commit b8165da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flent/plotters.py
Expand Up @@ -1271,8 +1271,8 @@ def get_series(self, series, results, config,
if end <= 0:
end += results.meta("TOTAL_LENGTH")

min_idx = data[0].searchsorted(start, side='right')
max_idx = data[0].searchsorted(end, side='left')
min_idx = data[0].searchsorted(start, side='left')
max_idx = data[0].searchsorted(end, side='right')

data = data[:, min_idx:max_idx]

Expand Down

0 comments on commit b8165da

Please sign in to comment.