aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/DropRateSearch.py
diff options
context:
space:
mode:
authorMatej Klotton <mklotton@cisco.com>2016-03-24 16:14:20 +0100
committerStefan Kobza <skobza@cisco.com>2016-04-22 15:06:08 +0000
commit8c12ff59f1a5e750151f5eb0e806dcc80e91c3c2 (patch)
treed42ae972c451e4d0714f000ce9262a64ca06848c /resources/libraries/python/DropRateSearch.py
parent4a7f950c10ca9bcf86e5ccbc3d49a3d7e3cb9809 (diff)
Reformat python libraries.
PEP8 reformat fix typos docstrings reformat Change-Id: Ic48ba4e06490630808b8e2ab1ab0b046ec7eeed7 Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'resources/libraries/python/DropRateSearch.py')
-rw-r--r--resources/libraries/python/DropRateSearch.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/resources/libraries/python/DropRateSearch.py b/resources/libraries/python/DropRateSearch.py
index c25f34fcf6..ceaebd57c3 100644
--- a/resources/libraries/python/DropRateSearch.py
+++ b/resources/libraries/python/DropRateSearch.py
@@ -320,14 +320,13 @@ class DropRateSearch(object):
else:
raise ValueError("Unknown search result type")
-
def linear_search(self, start_rate, traffic_type):
"""Linear search of rate with loss below acceptance criteria.
:param start_rate: Initial rate.
:param traffic_type: Traffic profile.
:type start_rate: float
- :param traffic_type: str
+ :type traffic_type: str
:return: nothing
"""
@@ -350,7 +349,7 @@ class DropRateSearch(object):
res = self._get_res_based_on_search_type(res)
if self._search_linear_direction == SearchDirection.BOTTOM_UP:
- # loss occured and it was above acceptance criteria
+ # loss occurred and it was above acceptance criteria
if not res:
# if this is first run then we didn't find drop rate
if prev_rate is None:
@@ -381,7 +380,7 @@ class DropRateSearch(object):
raise RuntimeError("Unknown search result")
elif self._search_linear_direction == SearchDirection.TOP_DOWN:
- # loss occured, decrease rate
+ # loss occurred, decrease rate
if not res:
prev_rate = rate
rate -= self._rate_linear_step
@@ -464,7 +463,7 @@ class DropRateSearch(object):
res = self._get_res_based_on_search_type(res)
- # loss occured and it was above acceptance criteria
+ # loss occurred and it was above acceptance criteria
if not res:
self.binary_search(b_min, rate, traffic_type)
# there was no loss / loss below acceptance criteria