aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--algorithms/algorithm.py12
-rw-r--r--algorithms/input_kind.py (renamed from algorithms/inputgen.py)0
-rw-r--r--algorithms/params.py2
-rw-r--r--plot.py2
-rw-r--r--test.py2
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
diff --git a/plot.py b/plot.py
index bf4ba02..55a1d6f 100644
--- a/plot.py
+++ b/plot.py
@@ -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
diff --git a/test.py b/test.py
index 67f0da0..524df22 100644
--- a/test.py
+++ b/test.py
@@ -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