diff options
Diffstat (limited to '')
-rw-r--r-- | algorithms/algorithm.py | 12 | ||||
-rw-r--r-- | algorithms/input_kind.py (renamed from algorithms/inputgen.py) | 0 | ||||
-rw-r--r-- | algorithms/params.py | 2 | ||||
-rw-r--r-- | plot.py | 2 | ||||
-rw-r--r-- | test.py | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/algorithms/algorithm.py b/algorithms/algorithm.py index 673a525..74817de 100644 --- a/algorithms/algorithm.py +++ b/algorithms/algorithm.py @@ -3,7 +3,7 @@ # For details, see https://github.com/egor-tensin/sorting-algorithms. # Distributed under the MIT License. -from . import inputgen +from . import input_kind class Algorithm: def __init__(self, codename, display_name, f): @@ -12,13 +12,13 @@ class Algorithm: self.function = f @staticmethod - def gen_input(n, case=inputgen.InputKind.AVERAGE): - #raise NotImplementedError('input generation is not defined for generic algorithms') - return inputgen.gen_input_for_sorting(n, case) + def gen_input(n, case=input_kind.InputKind.AVERAGE): + #raise NotImplementedError('input generation is not defined for a generic algorithm') + return input_kind.gen_input_for_sorting(n, case) class SortingAlgorithm(Algorithm): def __init__(self, codename, display_name, f): super().__init__(codename, display_name, f) - def gen_input(self, n, case=inputgen.InputKind.AVERAGE): - return inputgen.gen_input_for_sorting(n, case) + def gen_input(self, n, case=input_kind.InputKind.AVERAGE): + return input_kind.gen_input_for_sorting(n, case) diff --git a/algorithms/inputgen.py b/algorithms/input_kind.py index 998f1d6..998f1d6 100644 --- a/algorithms/inputgen.py +++ b/algorithms/input_kind.py diff --git a/algorithms/params.py b/algorithms/params.py index bf87976..edd1361 100644 --- a/algorithms/params.py +++ b/algorithms/params.py @@ -6,7 +6,7 @@ from enum import Enum from numbers import Integral -from .inputgen import InputKind +from .input_kind import InputKind from .plotter import PlotBuilder from . import registry from .timer import Timer @@ -6,7 +6,7 @@ import argparse import sys -from algorithms.inputgen import InputKind +from algorithms.input_kind import InputKind from algorithms.params import AlgorithmParameters import algorithms.registry as registry @@ -7,7 +7,7 @@ from array import array import argparse import sys -from algorithms.inputgen import InputKind +from algorithms.input_kind import InputKind import algorithms.registry as registry _DEFAULT_INPUT_KIND = InputKind.AVERAGE |