diff options
author | Jan Gelety <jgelety@cisco.com> | 2019-11-12 05:27:43 +0100 |
---|---|---|
committer | Jan Gelety <jgelety@cisco.com> | 2019-11-28 18:26:21 +0100 |
commit | d68951ac245150eeefa6e0f4156e4c1b5c9e9325 (patch) | |
tree | 487554a7547218d27f0a61ec02b70502c32cdcb4 /resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py | |
parent | ed0258a440cfad7023d643f717ab78ac568dc59b (diff) |
Python3: resources and libraries
Change-Id: I1392c06b1d64f62b141d24c0d42a8e36913b15e2
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py')
-rw-r--r-- | resources/libraries/python/MLRsearch/ReceiveRateMeasurement.py | 16 |
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})" |