From d3058fbcb8fbd96cb43ce45d154bd157b5a5a6a0 Mon Sep 17 00:00:00 2001 From: Michail Filippou <41775400+choosen23@users.noreply.github.com> Date: Wed, 26 Aug 2026 12:40:42 +0300 Subject: [PATCH] Fix CI on current black and mypy. Two checks in the tox env currently fail on main, so CI stops before the tests run. This affects every open pull request. `black --check src/` fails because recent releases collapse these short `.format` calls onto a single line. `mypy` fails on the return annotation of `imitation_dynamics`, which declares `Tuple[float, float]` but yields a pair of arrays. No behaviour change. --- src/nashpy/algorithms/support_enumeration.py | 4 +--- src/nashpy/game.py | 4 +--- src/nashpy/learning/imitation_dynamics.py | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/nashpy/algorithms/support_enumeration.py b/src/nashpy/algorithms/support_enumeration.py index 6c3727a..52b4fe9 100644 --- a/src/nashpy/algorithms/support_enumeration.py +++ b/src/nashpy/algorithms/support_enumeration.py @@ -254,7 +254,5 @@ def support_enumeration( An even number of ({}) equilibria was returned. This indicates that the game is degenerate. Consider using another algorithm to investigate. - """.format( - count - ) + """.format(count) warnings.warn(warning, RuntimeWarning) diff --git a/src/nashpy/game.py b/src/nashpy/game.py index 493d05f..3965c9f 100644 --- a/src/nashpy/game.py +++ b/src/nashpy/game.py @@ -61,9 +61,7 @@ def __repr__(self) -> str: {} Column player: -{}""".format( - tpe, *self.payoff_matrices - ) +{}""".format(tpe, *self.payoff_matrices) def __getitem__(self, key: Any) -> npt.NDArray: row_strategy, column_strategy = key diff --git a/src/nashpy/learning/imitation_dynamics.py b/src/nashpy/learning/imitation_dynamics.py index 1b2297c..8d0c1f1 100644 --- a/src/nashpy/learning/imitation_dynamics.py +++ b/src/nashpy/learning/imitation_dynamics.py @@ -35,7 +35,7 @@ def imitation_dynamics( iterations=1000, random_seed=None, threshold=0.5, -) -> Generator[Tuple[float, float], Any, None]: +) -> Generator[Tuple[npt.NDArray, npt.NDArray], Any, None]: """ Simulate the imitation dynamics for a given game represented by payoff matrices A and B.