diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-23 07:32:18 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2019-12-23 07:32:18 +0300 |
commit | 0d25b5d6957d76bab486e2279c99e130c19d5c31 (patch) | |
tree | c8c7d6fe4766470bda03e49a004afaa03c967b16 /algorithms/params.py | |
parent | Travis: add badge to README (diff) | |
download | sorting-algorithms-0d25b5d6957d76bab486e2279c99e130c19d5c31.tar.gz sorting-algorithms-0d25b5d6957d76bab486e2279c99e130c19d5c31.zip |
pylint/pep8 fixes
Diffstat (limited to '')
-rw-r--r-- | algorithms/params.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/algorithms/params.py b/algorithms/params.py index edd1361..787cfd1 100644 --- a/algorithms/params.py +++ b/algorithms/params.py @@ -11,6 +11,7 @@ from .plotter import PlotBuilder from . import registry from .timer import Timer + class TimeUnits(Enum): SECONDS = 'seconds' MILLISECONDS = 'milliseconds' @@ -19,16 +20,16 @@ class TimeUnits(Enum): def get_factor(self): if self is TimeUnits.SECONDS: return 1. - elif self is TimeUnits.MILLISECONDS: + if self is TimeUnits.MILLISECONDS: return 1000. - elif self is TimeUnits.MICROSECONDS: + if self is TimeUnits.MICROSECONDS: return 1000000. - else: - raise NotImplementedError('invalid time units: ' + str(self)) + raise NotImplementedError('invalid time units: ' + str(self)) def __str__(self): return self.value + class AlgorithmParameters: def __init__(self, algorithm, min_len, max_len, input_kind=InputKind.AVERAGE, iterations=1): @@ -121,10 +122,9 @@ class AlgorithmParameters: max_y = max(ys) if max_y > 0.1: return TimeUnits.SECONDS - elif max_y > 0.0001: + if max_y > 0.0001: return TimeUnits.MILLISECONDS - else: - return TimeUnits.MICROSECONDS + return TimeUnits.MICROSECONDS def plot_running_time(self, output_path=None): xs, ys = self.measure_running_time() |