From 76253bb1e0ddd7584a7c492c1a31bacf7045ed7a Mon Sep 17 00:00:00 2001 From: William Grochocinski Date: Fri, 7 Nov 2025 13:32:53 -0500 Subject: [PATCH 1/3] add `ty` as a dependency --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ea45feb1..14e9bae0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ ] [project.optional-dependencies] -dev = ["ruff>=0.14.2", "jupytext"] +dev = ["ruff>=0.14.2", "jupytext", "ty"] docs = ["sphinx>=8.2.3", "sphinx-autoapi>=3.6.1", "sphinx-rtd-theme>=3.0.2"] notebooks = ["ipykernel"] From c196d623c9afdb792abd14c329e95d04fc2fe131 Mon Sep 17 00:00:00 2001 From: William Grochocinski Date: Fri, 7 Nov 2025 13:33:20 -0500 Subject: [PATCH 2/3] add CI GitHub action for ty --- .github/workflows/ty.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/ty.yml diff --git a/.github/workflows/ty.yml b/.github/workflows/ty.yml new file mode 100644 index 00000000..5ddd2d9e --- /dev/null +++ b/.github/workflows/ty.yml @@ -0,0 +1,28 @@ +name: "ty CI" + +on: + push: + branches: [ "master", "development" ] + pull_request: + branches: [ "master" , "development" ] + +jobs: + type_checker: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + + - name: Install uv + run: pip install uv + + - name: Install Dependencies + run: uv sync --all-extras + + - name: ty Type Checking + run: uv run ty check From 337d06a6acdc1fb6e8965243265b91c76731ac8a Mon Sep 17 00:00:00 2001 From: William Grochocinski Date: Fri, 7 Nov 2025 13:34:54 -0500 Subject: [PATCH 3/3] add ty config file exclude failing files from check until fixed --- ty.toml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ty.toml diff --git a/ty.toml b/ty.toml new file mode 100644 index 00000000..a4586b52 --- /dev/null +++ b/ty.toml @@ -0,0 +1,41 @@ +[src] +# Ignore files that haven't been typed yet. +# As files are typed, they can be removed from this list. +# DO NOT ADD NEW FILES TO THIS LIST, NEW FILES SHOULD BE TYPED. +exclude = [ + "notebooks/demo_data_driven.ipynb", + "notebooks/demo_data_driven.py", + "notebooks/demo_fcsa.ipynb", + "notebooks/demo_fcsa.py", + "notebooks/demo_problem.ipynb", + "notebooks/demo_problem.py", + "scripts/list_directories.py", + "scripts/run_experiment.py", + "simopt/directory.py", + "simopt/experiment_base.py", + "simopt/gui/data_farming_window.py", + "simopt/gui/new_experiment_window.py", + "simopt/gui/plot_window.py", + "simopt/model.py", + "simopt/models/amusementpark.py", + "simopt/models/chessmm.py", + "simopt/models/cntnv.py", + "simopt/models/dualsourcing.py", + "simopt/models/dynamnews.py", + "simopt/models/facilitysizing.py", + "simopt/models/ironore.py", + "simopt/models/network.py", + "simopt/models/tableallocation.py", + "simopt/problem.py", + "simopt/solvers/astrodf.py", + "simopt/solvers/fcsa.py", + "simopt/utils.py", + "test/test_experiments.py", +] + +# See https://docs.astral.sh/ty/reference/rules/ for Rules documentation. +# Rule options are ["error", "warn", "ignore"] +[rules] +division-by-zero = "warn" # Default is "ignore" +possibly-unresolved-reference = "warn" # Default is "ignore" +unused-ignore-comment = "warn" # Default is "ignore"