From d2f38468a4787598b68f4aa9cca032e7805a517e Mon Sep 17 00:00:00 2001 From: Maoake Teriierooiterai Date: Wed, 1 Apr 2026 17:17:20 +0200 Subject: [PATCH] need to be merge to the main and add some line for the makefile --- Makefile | 8 ++++++-- a_maze_ing.py | 2 +- output_validator.py | 25 ------------------------- pyproject.toml | 1 + 4 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 output_validator.py diff --git a/Makefile b/Makefile index 1e67f70..e506793 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,15 @@ clean: lint: uv run flake8 . --exclude=.venv - uv run mypy . --warn-return-any --warn-unused-ignores --ignore-missing-imports --disallow-untyped-defs --check-untyped-defs + uv run env PYTHONPATH=src python3 -m mypy --warn-return-any --warn-unused-ignores --ignore-missing-imports --disallow-untyped-defs --check-untyped-defs src + uv run env PYTHONPATH=src python3 -m mypy --warn-return-any --warn-unused-ignores --ignore-missing-imports --disallow-untyped-defs --check-untyped-defs tests + uv run env PYTHONPATH=src python3 -m mypy --warn-return-any --warn-unused-ignores --ignore-missing-imports --disallow-untyped-defs --check-untyped-defs a_maze_ing.py lint-strict: uv run flake8 . --exclude=.venv - uv run mypy . --strict + uv run env PYTHONPATH=src python3 -m mypy --strict src + uv run env PYTHONPATH=src python3 -m mypy --strict tests + uv run env PYTHONPATH=src python3 -m mypy --strict a_maze_ing.py run_test_parsing: PYTHONPATH=src uv run pytest tests/test_parsing.py diff --git a/a_maze_ing.py b/a_maze_ing.py index d1232dc..ce30c6f 100644 --- a/a_maze_ing.py +++ b/a_maze_ing.py @@ -2,7 +2,7 @@ from typing import Any from numpy.typing import NDArray from src.AMazeIng import AMazeIng from src.parsing import Parsing -from mlx import Mlx # type: ignore +from mlx import Mlx import time diff --git a/output_validator.py b/output_validator.py deleted file mode 100644 index dfc16eb..0000000 --- a/output_validator.py +++ /dev/null @@ -1,25 +0,0 @@ -# This script does not check for errors or malformed files. -# It only validates that neighbooring cells sharing a wall have -# both the correct encoding. -# Usage: python3 output_validator.py output_maze.txt - -import sys - -if len(sys.argv) != 2: - print(f"Usage: python3 {sys.argv[0]} ") - sys.exit(1) - -g = [] -for line in open(sys.argv[1]): - if line.strip() == '': - break - g.append([int(c, 16) for c in line.strip(' \t\n\r')]) - -for r in range(len(g)): - for c in range(len(g[0])): - v = g[r][c] - if not all([(r < 1 or v & 1 == (g[r-1][c] >> 2) & 1), - (c >= len(g[0])-1 or (v >> 1) & 1 == (g[r][c+1] >> 3) & 1), - (r >= len(g)-1 or (v >> 2) & 1 == g[r+1][c] & 1), - (c < 1 or (v >> 3) & 1 == (g[r][c-1] >> 1) & 1)]): - print(f'Wrong encoding for ({c},{r})') diff --git a/pyproject.toml b/pyproject.toml index 11a0fd9..264aa10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ dev = [ [tool.mypy] python_version = "3.10" +explicit_package_bases = true [tool.pytest.ini_options] pythonpath = ["src"]