Skip to content

Commit f887b01

Browse files
committed
Clean up tournament arguments and docstrings
1 parent a94a7f5 commit f887b01

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

axelrod/tournament.py

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def __init__(self, players, match_generator=RoundRobinMatches,
3535
The number of turns per match
3636
repetitions : integer
3737
The number of times the round robin should be repeated
38-
processes : integer
39-
The number of processes to be used for parallel processing
4038
noise : float
4139
The probability that a player's intended action should be flipped
4240
with_morality : boolean
@@ -80,9 +78,11 @@ def play(self, build_results=True, filename=None,
8078
whether or not to build a results st
8179
filename : string
8280
name of output file
81+
processes : integer
82+
The number of processes to be used for parallel processing
8383
progress_bar : bool
8484
Whether or not to create a progress bar which will be updated
85-
interactions : bool
85+
keep_interactions : bool
8686
Whether or not to load the interactions in to memory
8787
8888
Returns
@@ -237,8 +237,6 @@ def _process_done_queue(self, workers, done_queue, progress_bar=False):
237237
The number of sub-processes in existence
238238
done_queue : multiprocessing.Queue
239239
A queue containing the output dictionaries from each round robin
240-
interactions : list
241-
The list of interactions per repetition to update with results
242240
progress_bar : bool
243241
Whether or not to update the tournament progress bar
244242
"""
@@ -312,8 +310,7 @@ class ProbEndTournament(Tournament):
312310

313311
def __init__(self, players, match_generator=ProbEndRoundRobinMatches,
314312
name='axelrod', game=None, prob_end=.5, repetitions=10,
315-
noise=0,
316-
with_morality=True):
313+
noise=0, with_morality=True):
317314
"""
318315
Parameters
319316
----------
@@ -329,8 +326,6 @@ def __init__(self, players, match_generator=ProbEndRoundRobinMatches,
329326
The probability of a given match ending
330327
repetitions : integer
331328
The number of times the round robin should be repeated
332-
processes : integer
333-
The number of processes to be used for parallel processing
334329
noise : float
335330
The probability that a player's intended action should be flipped
336331
with_morality : boolean
@@ -350,17 +345,13 @@ class SpatialTournament(Tournament):
350345
A tournament in which the players are allocated in a graph as nodes
351346
and they players only play the others that are connected to with an edge.
352347
"""
353-
def __init__(self, players, edges, match_generator=SpatialMatches,
354-
name='axelrod', game=None, turns=200, repetitions=10,
355-
noise=0,
356-
with_morality=True):
348+
def __init__(self, players, edges, name='axelrod', game=None, turns=200,
349+
repetitions=10, noise=0, with_morality=True):
357350
"""
358351
Parameters
359352
----------
360353
players : list
361354
A list of axelrod.Player objects
362-
match_generator : class
363-
A class that must be descended from axelrod.MatchGenerator
364355
name : string
365356
A name for the tournament
366357
game : axelrod.Game
@@ -369,8 +360,6 @@ def __init__(self, players, edges, match_generator=SpatialMatches,
369360
A list of tuples containing the existing edges
370361
repetitions : integer
371362
The number of times the round robin should be repeated
372-
processes : integer
373-
The number of processes to be used for parallel processing
374363
noise : float
375364
The probability that a player's intended action should be flipped
376365
with_morality : boolean
@@ -391,17 +380,13 @@ class ProbEndSpatialTournament(ProbEndTournament):
391380
and they players only play the others that are connected to with an edge.
392381
Players do not know the length of a given match (it is randomly sampled).
393382
"""
394-
def __init__(self, players, edges, match_generator=SpatialMatches,
395-
name='axelrod', game=None, prob_end=.5, repetitions=10,
396-
noise=0,
397-
with_morality=True):
383+
def __init__(self, players, edges, name='axelrod', game=None, prob_end=.5,
384+
repetitions=10, noise=0, with_morality=True):
398385
"""
399386
Parameters
400387
----------
401388
players : list
402389
A list of axelrod.Player objects
403-
match_generator : class
404-
A class that must be descended from axelrod.MatchGenerator
405390
name : string
406391
A name for the tournament
407392
game : axelrod.Game
@@ -412,8 +397,6 @@ def __init__(self, players, edges, match_generator=SpatialMatches,
412397
A list of tuples containing the existing edges
413398
repetitions : integer
414399
The number of times the round robin should be repeated
415-
processes : integer
416-
The number of processes to be used for parallel processing
417400
noise : float
418401
The probability that a player's intended action should be flipped
419402
with_morality : boolean

0 commit comments

Comments
 (0)