Skip to content

Commit 2f24224

Browse files
gaffney2010marcharper
authored andcommitted
Clean up docstrings, to match parameter-listing to actual parameters. (#1232)
* Clean up docstrings, to match parameter-listing to actual parameters. * Response to @meatballs' feedback.
1 parent 1585233 commit 2f24224

File tree

7 files changed

+22
-24
lines changed

7 files changed

+22
-24
lines changed

axelrod/eigen.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ def principal_eigenvector(
5656
------
5757
mat: numpy.array
5858
The matrix to use for multiplication iteration
59-
initial: numpy.array, None
60-
The initial state. Will be set to numpy.array([1, 1, ...]) if None
6159
maximum_iterations: int, None
6260
The maximum number of iterations of the approximation
6361
max_error: float, 1e-8

axelrod/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def complete_graph(size, loops=True):
129129
----------
130130
size: int
131131
Number of vertices in the cycle
132-
directed: bool, False
133-
Is the graph directed?
132+
loops: bool, True
133+
Should the graph contain cycles?
134134
135135
Returns
136136
-------

axelrod/match_generator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ def __init__(
1818
----------
1919
players : list
2020
A list of axelrod.Player objects
21+
repetitions : int
22+
The number of repetitions of a given match
2123
turns : integer
2224
The number of turns per match
23-
prob_end : float
24-
The probability of a given turn ending a match
2525
game : axelrod.Game
2626
The game object used to score the match
27-
repetitions : int
28-
The number of repetitions of a given match
2927
noise : float, 0
3028
The probability that a player's intended action should be flipped
29+
prob_end : float
30+
The probability of a given turn ending a match
3131
edges : list
3232
A list of edges between players
3333
match_attributes : dict

axelrod/moran.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def __init__(
9292
noise:
9393
The background noise, if any. Randomly flips plays with probability
9494
`noise`.
95+
game: axelrod.Game
96+
The game object used to score matches.
9597
deterministic_cache:
9698
A optional prebuilt deterministic cache
9799
mutation_rate:

axelrod/result_set.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def __init__(
5656
efficiently read from file.
5757
processes : integer
5858
The number of processes to be used for parallel processing
59+
progress_bar: boolean
60+
If a progress bar will be shown.
5961
"""
6062
self.filename = filename
6163
self.players, self.repetitions = players, repetitions
@@ -186,8 +188,7 @@ def _reshape_three_dim_list(
186188
"""
187189
Parameters
188190
----------
189-
190-
payoffs_series : pandas.Series
191+
series : pandas.Series
191192
first_dimension : iterable
192193
second_dimension : iterable
193194
third_dimension : iterable
@@ -223,7 +224,6 @@ def _reshape_two_dim_list(self, series):
223224
"""
224225
Parameters
225226
----------
226-
227227
series : pandas.Series
228228
229229
Returns:
@@ -446,7 +446,6 @@ def _build_eigenmoses_rating(self):
446446
"""
447447
Returns:
448448
--------
449-
450449
The eigenmoses rating as defined in:
451450
http://www.scottaaronson.com/morality.pdf
452451
"""
@@ -459,7 +458,6 @@ def _build_eigenjesus_rating(self):
459458
"""
460459
Returns:
461460
--------
462-
463461
The eigenjesus rating as defined in:
464462
http://www.scottaaronson.com/morality.pdf
465463
"""
@@ -474,7 +472,6 @@ def _build_cooperating_rating(self):
474472
"""
475473
Returns:
476474
--------
477-
478475
The list of cooperation ratings
479476
List of the form:
480477
@@ -514,7 +511,6 @@ def _build_vengeful_cooperation(self):
514511
"""
515512
Returns:
516513
--------
517-
518514
The vengeful cooperation matrix derived from the
519515
normalised cooperation matrix:
520516
@@ -608,7 +604,6 @@ def __eq__(self, other):
608604
609605
Parameters
610606
----------
611-
612607
other : axelrod.ResultSet
613608
Another results set against which to check equality
614609
"""
@@ -642,7 +637,6 @@ def __ne__(self, other):
642637
643638
Parameters
644639
----------
645-
646640
other : axelrod.ResultSet
647641
Another results set against which to check inequality
648642
"""
@@ -656,7 +650,6 @@ def summarise(self):
656650
657651
Output
658652
------
659-
660653
A list of the form:
661654
662655
[[player name, median score, cooperation_rating],...]

axelrod/strategy_transformers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ def StrategyTransformerFactory(strategy_wrapper, name_prefix=None, reclassifier=
3636
A function of the form `strategy_wrapper(player, opponent, proposed_action, *args, **kwargs)`
3737
Can also use a class that implements
3838
def __call__(self, player, opponent, action)
39-
wrapper_args: tuple
40-
Any arguments to pass to the wrapper
41-
wrapper_kwargs: dict
42-
Any keyword arguments to pass to the wrapper
4339
name_prefix: string, "Transformed "
4440
A string to prepend to the strategy and class name
4541
reclassifier: function,

axelrod/tournament.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def play(
115115
Parameters
116116
----------
117117
build_results : bool
118-
whether or not to build a results st
118+
whether or not to build a results set
119119
filename : string
120120
name of output file
121121
processes : integer
@@ -295,7 +295,8 @@ def _run_parallel(self, processes: int = 2, build_results: bool = True) -> bool:
295295
296296
Parameters
297297
----------
298-
298+
build_results : bool
299+
whether or not to build a results set
299300
processes : int
300301
How many processes to use.
301302
"""
@@ -346,6 +347,8 @@ def _start_workers(
346347
A queue containing an entry for each round robin to be processed
347348
done_queue : multiprocessing.Queue
348349
A queue containing the output dictionaries from each round robin
350+
build_results : bool
351+
whether or not to build a results set
349352
"""
350353
for worker in range(workers):
351354
process = Process(
@@ -367,6 +370,8 @@ def _process_done_queue(
367370
The number of sub-processes in existence
368371
done_queue : multiprocessing.Queue
369372
A queue containing the output dictionaries from each round robin
373+
build_results : bool
374+
whether or not to build a results set
370375
"""
371376
out_file, writer = self._get_file_objects(build_results)
372377
progress_bar = self._get_progress_bar()
@@ -395,6 +400,8 @@ def _worker(self, work_queue: Queue, done_queue: Queue, build_results: bool = Tr
395400
A queue containing an entry for each round robin to be processed
396401
done_queue : multiprocessing.Queue
397402
A queue containing the output dictionaries from each round robin
403+
build_results : bool
404+
whether or not to build a results set
398405
"""
399406
for chunk in iter(work_queue.get, "STOP"):
400407
interactions = self._play_matches(chunk, build_results)
@@ -410,6 +417,8 @@ def _play_matches(self, chunk, build_results=True):
410417
----------
411418
chunk : tuple (index pair, match_parameters, repetitions)
412419
match_parameters are also a tuple: (turns, game, noise)
420+
build_results : bool
421+
whether or not to build a results set
413422
414423
Returns
415424
-------

0 commit comments

Comments
 (0)