diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-06 21:45:45 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-06 21:45:45 +0200 |
| commit | fba834a617d2d2905cfc84595de100f8a5368c0a (patch) | |
| tree | 2b629a72dacfec75a6cf28a298ff309602cfff5d | |
| parent | workflows/ci: remove on: pull_request (diff) | |
| download | sorting-algorithms-fba834a617d2d2905cfc84595de100f8a5368c0a.tar.gz sorting-algorithms-fba834a617d2d2905cfc84595de100f8a5368c0a.zip | |
sort out scripts into proper directories
Diffstat (limited to '')
| -rw-r--r-- | .github/workflows/ci.yml | 2 | ||||
| -rwxr-xr-x | algorithms/scripts/plot.py (renamed from plot.py) | 6 | ||||
| -rwxr-xr-x | algorithms/scripts/test.py (renamed from test.py) | 4 | ||||
| -rw-r--r-- | scripts/plot.bat (renamed from plot.bat) | 1 | ||||
| -rwxr-xr-x | scripts/plot.sh (renamed from plot.sh) | 15 | ||||
| -rwxr-xr-x | scripts/plot_all.sh (renamed from .ci/plot.sh) | 2 |
6 files changed, 16 insertions, 14 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 066e684..4f01a7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,4 +24,4 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - name: Run tests - run: ./.ci/plot.sh + run: ./scripts/plot_all.sh diff --git a/plot.py b/algorithms/scripts/plot.py index 5105e5f..bb441e1 100755 --- a/plot.py +++ b/algorithms/scripts/plot.py @@ -8,9 +8,9 @@ import argparse import sys -from algorithms.input_kind import InputKind -from algorithms.params import AlgorithmParameters -import algorithms.registry as registry +from ..input_kind import InputKind +from ..params import AlgorithmParameters +from .. import registry _DEFAULT_ITERATIONS = 100 diff --git a/test.py b/algorithms/scripts/test.py index b03bf88..ba7bf0a 100755 --- a/test.py +++ b/algorithms/scripts/test.py @@ -9,8 +9,8 @@ from array import array import argparse import sys -from algorithms.input_kind import InputKind -import algorithms.registry as registry +from ..input_kind import InputKind +import ..registry as registry _DEFAULT_INPUT_KIND = InputKind.AVERAGE diff --git a/plot.bat b/scripts/plot.bat index 3a2f22d..c76c43a 100644 --- a/plot.bat +++ b/scripts/plot.bat @@ -29,6 +29,7 @@ if "%~4" == "" ( set "max=%~4" ) +cd .. mkdir /p img for %%i in (best average worst) do ( diff --git a/plot.sh b/scripts/plot.sh index 60bad3a..d310dcd 100755 --- a/plot.sh +++ b/scripts/plot.sh @@ -32,17 +32,18 @@ main() { local max="$default_max" [ "$#" -ge 4 ] && max="$4" - mkdir -p -- "$script_dir/img" + cd -- "$script_dir/.." + mkdir -p -- img local input_kind for input_kind in best average worst; do local output_name="${algorithm}_${iterations}_${input_kind}_${min}_${max}.png" - python "$script_dir/plot.py" \ - "$algorithm" \ - --input "$input_kind" \ - --min "$min" --max "$max" \ - --iterations "$iterations" \ - --output "$script_dir/img/$output_name" + python -m algorithms.scripts.plot \ + "$algorithm" \ + --input "$input_kind" \ + --min "$min" --max "$max" \ + --iterations "$iterations" \ + --output "img/$output_name" done } diff --git a/.ci/plot.sh b/scripts/plot_all.sh index fee1166..1e56f40 100755 --- a/.ci/plot.sh +++ b/scripts/plot_all.sh @@ -39,7 +39,7 @@ main() { local algorithm for algorithm in ${algorithm_list[@]+"${algorithm_list[@]}"}; do echo "Plotting algorithm $algorithm..." - "$script_dir/../plot.sh" "$algorithm" + "$script_dir/plot.sh" "$algorithm" done } |
