Python3: resources and libraries
[csit.git] / resources / libraries / python / MLRsearch / ReceiveRateMeasurement.py
index d052ebd..31a6f82 100644 (file)
@@ -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:
 # 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."""
 
 
 """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):
     """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."""
 
     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."""
 
     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})"