From 65297dd574e583a6368633875756a355fda30744 Mon Sep 17 00:00:00 2001 From: somakui Date: Thu, 15 Oct 2026 17:05:12 +0200 Subject: [PATCH] toml update, compute.py test_function und tabulate Ausgabe --- AGENTS.md | 4 ++++ compute.py | 8 ++++++-- pyproject.toml | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 AGENTS.md create mode 100644 pyproject.toml diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..79a2eba --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,4 @@ +# Regeln für dieses Projekt +- Code nach PEP 8, Zeilenlänge maximal 88 Zeichen. +- Jede Funktion und Methode hat einen Docstring und Type Hints. +- Vor jedem Commit: `ruff check` und `ruff format`. \ No newline at end of file diff --git a/compute.py b/compute.py index f4406ef..9b7084b 100644 --- a/compute.py +++ b/compute.py @@ -2,6 +2,8 @@ import math +from tabulate import tabulate + def matmul(matrix_a: list[list[float]], matrix_b: list[list[float]]) -> list[list[float]]: """Berechnet das Matrixprodukt zweier Matrizen (matrix_a @ matrix_b). @@ -74,7 +76,8 @@ def rot_2d(angle: float) -> list[list[float]]: [sin_theta, cos_theta], ] -if __name__ == "__main__": + +def test_functions(): a1 = [ [3, 4, -1, 4], [-2, 2, 5, 1], @@ -171,4 +174,5 @@ if __name__ == "__main__": assert math.isclose(rotated_point[1][0], 1.0, abs_tol=1e-9) print("Test rot_2D (Vektordrehung mit matmul) erfolgreich bestanden!") -# Test-Änderung \ No newline at end of file +if __name__ == "__main__": + print(tabulate(rot_2d(1.0))) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3a776b1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[project] +name = "matrixmania" +version = "0.1.0" +dependencies = ["tabulate", "ruff"] \ No newline at end of file