aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py')
-rw-r--r--resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py b/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py
index d052ebd3bf..31a6f8202e 100644
--- a/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py
+++ b/resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Cisco and/or its affiliates.
+# Copyright (c) 2019 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -14,7 +14,7 @@
"""Module defining ReceiveRateMeasurement class."""
-class ReceiveRateMeasurement(object):
+class ReceiveRateMeasurement:
"""Structure defining the result of single Rr measurement."""
def __init__(self, duration, target_tr, transmit_count, loss_count):
@@ -43,12 +43,12 @@ class ReceiveRateMeasurement(object):
def __str__(self):
"""Return string reporting input and loss fraction."""
- return "d={dur!s},Tr={rate!s},Df={frac!s}".format(
- dur=self.duration, rate=self.target_tr, frac=self.loss_fraction)
+ return f"d={self.duration!s},Tr={self.target_tr!s}," \
+ f"Df={self.loss_fraction!s}"
def __repr__(self):
"""Return string evaluable as a constructor call."""
- return ("ReceiveRateMeasurement(duration={dur!r},target_tr={rate!r}"
- ",transmit_count={trans!r},loss_count={loss!r})".format(
- dur=self.duration, rate=self.target_tr,
- trans=self.transmit_count, loss=self.loss_count))
+ return f"ReceiveRateMeasurement(duration={self.duration!r}," \
+ f"target_tr={self.target_tr!r}," \
+ f"transmit_count={self.transmit_count!r}," \
+ f"loss_count={self.loss_count!r})"