From 75dfaba241d3f1d51fd9c92f49bd4adfdba25207 Mon Sep 17 00:00:00 2001 From: Matthew Middlehurst Date: Wed, 9 Oct 2024 17:03:53 +0300 Subject: [PATCH] [MNT] `mypy` fixes (#295) * mypy * symlink --- .github/workflows/periodic_tests.yml | 25 +++++++++++++++++++ .github/workflows/pr_typecheck.yml | 2 +- pyproject.toml | 8 +++++- .../distance_based_clustering/_plot_path.py | 6 ++--- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.github/workflows/periodic_tests.yml b/.github/workflows/periodic_tests.yml index 0049382a..2c409c56 100644 --- a/.github/workflows/periodic_tests.yml +++ b/.github/workflows/periodic_tests.yml @@ -39,6 +39,31 @@ jobs: with: extra_args: --all-files + typecheck: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install tsml-eval, dependencies and mypy + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 3 + command: python -m pip install .[all_extras,unstable_extras,dev] mypy + + - name: Show dependencies + run: python -m pip list + + - name: Run mypy typecheck + run: mypy tsml_eval/ + run-notebook-examples: runs-on: ubuntu-20.04 diff --git a/.github/workflows/pr_typecheck.yml b/.github/workflows/pr_typecheck.yml index 6622f38e..c38f5e22 100644 --- a/.github/workflows/pr_typecheck.yml +++ b/.github/workflows/pr_typecheck.yml @@ -27,7 +27,7 @@ jobs: with: python-version: "3.10" - - name: Install aeon, dependencies and mypy + - name: Install tsml-eval, dependencies and mypy uses: nick-fields/retry@v3 with: timeout_minutes: 30 diff --git a/pyproject.toml b/pyproject.toml index 071cdaa7..623951e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -150,7 +150,13 @@ per-file-ignores = [ [tool.mypy] mypy_path = "tsml_eval/" -exclude = ["_wip"] +ignore_missing_imports = true +exclude = [ + "_wip", + # Ignore the publications symlinks and its contents + "tsml_eval/publications/2023", +] + [tool.pytest.ini_options] testpaths = "tsml_eval" diff --git a/tsml_eval/publications/y2023/distance_based_clustering/_plot_path.py b/tsml_eval/publications/y2023/distance_based_clustering/_plot_path.py index 63cd29be..05ef7bd6 100644 --- a/tsml_eval/publications/y2023/distance_based_clustering/_plot_path.py +++ b/tsml_eval/publications/y2023/distance_based_clustering/_plot_path.py @@ -91,9 +91,9 @@ def _plot_path( width = height = 0.65 bottom_h = bottom + height + 0.02 - rect_s_y = [left, bottom, w_ts, height] - rect_gram = [left_h, bottom, width, height] - rect_s_x = [left_h, bottom_h, width, h_ts] + rect_s_y = (left, bottom, w_ts, height) + rect_gram = (left_h, bottom, width, height) + rect_s_x = (left_h, bottom_h, width, h_ts) ax_gram = plt.axes(rect_gram) ax_s_x = plt.axes(rect_s_x)