Repository navigation
Fix death-birth MoranProcess pairing wrong players - #1502
barlowa124 wants to merge 62 commits into
Conversation
…-patch-3 Add a thesis to citations
I've noticed that the "The Prisoner's Dilemma Competition" (http://www.prisoners-dilemma.com/competition.html) doesn't exist anymore on the website. I've added the archived version at the Wayback Machine.
Disable type checker temporarily
…n_warnings Fix string escape to suppress deprecation warning
I used cff init website to create a CITATION.cff file based on the author's information. There were some unclear given or family names. I made judgment calls, but please review them to ensure that they are correctly attributed. I included the readthedocs as a landing website and the GitHub's webpage as the location of the repository. Additional information about the authors (i.e., email, affiliation and ORCID) can optionally be added. I think the file's format is pretty clear but notify if that is not the case.
* Change workflow to test Python 3.11 instead of 3.8 * Update setup.py to use Python 3.11
…xelrod-Python#1407) * Split requirements.txt to factor out hypothesis and prompt_toolkit * Point config.yml to new requirements file * Rewrite setup.py to use pathlib * Correct documentation update * Attempt to exclude condition import from coverage * Change pragma no cover for human strategy inclusion * Attempt to fix unused-import check for human strategy when prompt_toolkit is missing * Format with black
run black on ubuntu only, change order of some tests
…#1413) * Added asymmetric games and made regular games a subclass * small improvements to code style * fixing docs mock... * Revert "fixing docs mock..." This reverts commit 09fb251. * used IntEnum to simplify * small improvements & a fix * added asymmetric games to docs * added werror if invalid payoff matrices are given * removed .item() * changed dbs.action_to_int to use IntEnum behaviour * Revert "changed dbs.action_to_int to use IntEnum behaviour" This reverts commit bb6171c. * made library code more robust wrt integer actions * all strategies now work with integer actions * added tests and fixed __eq__ * improved coverage * changed Action back to Enum and added casting to score * added casting test * removed numpy mocking * changed doc due to doctests being picky * re-fixed doctest examples * review changes * Added tutorial for implementing new games * fixed formatting * made doctests work
* added a read the docs config file * moved yaml to root directory
The tests were failing on ubuntu https://github.com/Axelrod-Python/Axelrod/actions/runs/8198844499/job/22423011180?pr=1428 This was caused by some rounding error. I think this cleans things up.
* Move to pyproject.toml. This uses hatch. Note I've removed the human player. I don't believe we ever use it. If we want to we can add it back in. * Bump version number.
* moved seed to tourney arg in hello world docs * formatting --------- Co-authored-by: Ian Miller <ianmiller@Ians-Mac.local>
* bump deps * revert numpy to 1.26.4 * bump tox * typo
Reduce match init complexity
Create MatchChunk dataclass
…pattern Change cache pattern
…rod-Python#1458) * Improve extend method in LimitedHistory to enforce memory depth - Updated the extend method in the LimitedHistory class to properly truncate oldest entries when the combined history exceeds the defined memory depth. - Added a corresponding unit test in axelrod/tests/unit/test_history.py to validate this behavior. - Formatted all committed files using black for consistent code style. * Ignore workflow failures by adding suppress_health_check - add suppress_health_check to test_equality function in test_game.py to prevent workflow failure in Github remote. - Update HealthCheck module import order in test_game.py
* add freqAnalyzer strat * cleanup + wip * remove spurious changes * fixed freq analyzer test * Delete axelrod/tests/strategies/test_freqanalyzer.py * bump num strats * remove unnecessary lines * fix type error * fix test * formatting * python black with correct options * add strat to index * code cleanup
* add original index to summary * formatting * fix summary test * rm spurious print statement * fix failing doctest * doctest attempt * attempt * cleanup * formatting
* Get mypy working again * Add test for new assert * Test error string * Inject get_data for testing * More typing stuff for mypy to pass * Ran black * Added more mypy stuff to plot
* Add Momentum strategy
… Prisoner's Dilemma (Axelrod-Python#1471) * Adding attention strategy * Adding deadline=None * Adding verbosity to see which test is stalling the CI on ubuntu * Use spawn instead of fork for new process * Removing pytest-xdist -n auto * Long run time * Adding evolved attentio to long run strategies * Adding min_value for s = 0 * Changing max_examples=5 to max_examples=2 * Adding test against strategies * Removing stochastic strategy in test * Fixing randomize test * Lazy loading of model weights * mypy compliance * Shorter run time for test_meta * Adding coverage to frequency analyzer
* Add link to discord server. * Suppress too slow healthcheck. * Fix ordering of imports.
* Fix numpy problem. * Bump numpy version and modify outputs. This makes all outputs be python floats. This somewhat fits with the original (perhaps mistake) approach of the library where outputs are all python objects (for example the results_set.payoff_matrix is a list of lists although arguably should be a numpy array). * Add support for py 3.13 + 3.14 * Bump numpy version. * Format with black. * Reorder tox so black runs first.
In mode="db", _matchup_indices() used the enumerate position in the dead node's neighbour list as the player index, so score_all() played and credited the wrong players. Use self.index[source] so both modes use global player positions. Fixes Axelrod-Python#1499.
|
The test is failing because the black formatter needs to be run. |
|
Took this for a spin locally on top of 153335c: |
|
Thanks for this @barlowa124. The only thing stopping CI from passing is the formatting of the new test. Could you run: and push the result? |
|
Done in 73fb176. Ran |
73fb176 to
7ad24fe
Compare
Fixes #1499.
In
MoranProcesswithmode="db",_matchup_indices()built matchupsfrom two different index spaces:
enumerate(sources)produced positionsin the dead node's neighbour list, while
self.index[target]producedglobal player positions.
score_all()then played and credited the wrongplayers. Nothing raised, which kept it hidden.
Birth-death mode was unaffected only by accident: there
sourcescoversevery vertex, so the enumerate counter coincides with
self.index[source].The change uses
self.index[source]in both modes, so matchup pairs arealways global player positions. On the issue's reproduction (5-cycle,
player 2 dead) matchups go from
{(0, 0), (1, 4)}to{(1, 0), (3, 4)}:the dead node's neighbours (players 1 and 3) each play their own
out-neighbours, and the dead vertex is skipped.
A regression test pins the matchup set and the resulting scores in the
exact internal state
__next__creates beforescore_all().pytest axelrod/tests/unit/test_moran.pypasses: 44 tests.