Skip to content

Commit c8e5386

Browse files
committed
Correct formatting of docstring.
1 parent 6bb15b3 commit c8e5386

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

run_strategy_indexer.py

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@
77
import os
88

99
def read_index(index_path):
10-
"""Read the index of strategies"""
10+
"""
11+
Read the index of strategies
12+
13+
Parameters
14+
----------
15+
index_path : str
16+
A file path for the index file where all strategies are auto documented
17+
18+
Returns
19+
-------
20+
strategies_reference : str
21+
The string value of the contents of the index file.
22+
"""
1123
with open(index_path, "r") as f:
1224
strategies_reference = f.read()
1325
return strategies_reference
@@ -16,6 +28,16 @@ def get_module_name(module_path):
1628
"""
1729
Take string of the form `./axelrod/strategies/titfortat.py` and returns
1830
`titfortat`.
31+
32+
Parameters
33+
----------
34+
module_path : str
35+
A file path for a module file.
36+
37+
Returns
38+
-------
39+
module_name : str
40+
The name of the module
1941
"""
2042
filename = os.path.basename(module_path)
2143
module_name = os.path.splitext(filename)[0]
@@ -25,11 +47,24 @@ def check_module(module_path,
2547
index_path="./docs/reference/all_strategies.rst",
2648
excluded=("_strategies", "__init__", "_filters", "human")):
2749
"""
28-
Check if a module is contained in the index of strategies
50+
Check if a module name is written in the index of strategies.
51+
52+
Parameters
53+
----------
54+
module_path : str
55+
A file path for a module file.
56+
index_path : str
57+
A file path for the index file where all strategies are auto documented
58+
excluded : tuple
59+
A collection of module names to be ignored
60+
61+
Returns
62+
-------
63+
boolean : bool
64+
True/False if module is referenced.
2965
30-
Returns boolean: True/False if module is referenced.
3166
"""
32-
strategies_reference = read_index(index_path)
67+
strategies_index = read_index(index_path)
3368
module_name = get_module_name(module_path)
3469
if module_name not in excluded:
3570
if module_name not in strategies_reference:

0 commit comments

Comments
 (0)