Skip to content

Commit a8be626

Browse files
authored
Merge pull request #16 from cnerg/numpy_docs
2 parents 4cf5171 + c252ba3 commit a8be626

File tree

2 files changed

+54
-31
lines changed

2 files changed

+54
-31
lines changed

acme_corp/do_task.py

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@
44

55
logger = logging.getLogger(__name__)
66

7-
# using Sphinx docstrings style: <https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html>
7+
# using numpy style docstrings style: <https://numpydoc.readthedocs.io/en/stable/format.html>
88

99
def perform_action(args, input_data):
1010
"""Perform some action
1111
1212
Following the principle of separation of concerns, this method only
1313
performs the action, but does not have any input or output.
1414
15-
:param args: argparse object with many possible members based on argparse configuration
16-
:type args: argparse.ArgumentParser
17-
:param input_data: dictionary of input data read from YAML file
18-
:type input_data: dict
19-
:returns: string that describes the input quantities
20-
:rtype: str
15+
Parameters
16+
----------
17+
args : argparse.ArgumentParser
18+
argparse object with many possible members based on argparse
19+
configuration
20+
input_data : dict
21+
dictionary of input data read from YAML file
22+
23+
Returns
24+
-------
25+
str
26+
string that describes the input quantities
2127
"""
2228

2329
return f"Some results based on args:\n{args}\n and input_data:\n{input_data}\n"
@@ -29,12 +35,18 @@ def report_results(args, input_data, results):
2935
Following the principle of separation of concerns, this method only
3036
performs output and does not do any actions.
3137
32-
:param args: argparse object with many possible members based on argparse configuration
33-
:type args: argparse.ArgumentParser
34-
:param input_data: dictionary of input data read from YAML file
35-
:type input_data: dict
38+
Parameters
39+
----------
40+
args : argparse.ArgumentParser
41+
argparse object with many possible members based on argparse
42+
configuration
43+
input_data : dict
44+
dictionary of input data read from YAML file
3645
37-
:returns: None
46+
Returns
47+
-------
48+
unknown
49+
None
3850
"""
3951

4052
logger.info(
@@ -50,8 +62,10 @@ def task_args():
5062
`filename` : required positional argument
5163
`verbose` : optional keyword argument
5264
53-
:returns: argparse object with various members depending on configuration
54-
:rtype: argparse.ArgumentParser
65+
Returns
66+
-------
67+
argparse.ArgumentParser
68+
argparse object with various members depending on configuration
5569
"""
5670

5771
parser = argparse.ArgumentParser(
@@ -75,10 +89,17 @@ def read_input(input_filename):
7589
7690
inputs
7791
-------
78-
:param input_filename: a string with a filename/path accessible from the current location
79-
:type input_filename: str
80-
:returns: the data from the YAML file.
81-
:rtype: dict
92+
93+
Parameters
94+
----------
95+
input_filename : str
96+
a string with a filename/path accessible from the current
97+
location
98+
99+
Returns
100+
-------
101+
dict
102+
the data from the YAML file.
82103
"""
83104

84105
with open(input_filename, "r") as yaml_file:

acme_corp/piano.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
class Piano:
2-
"""
3-
A grand piano proudly built by ACME corporation.
2+
"""A grand piano proudly built by ACME corporation.
43
54
Weighing half a ton be careful when hoisting this precariously over
65
sidewalks.
76
8-
.. warning::
9-
Always use proper rigging techniques when hoisting this above
10-
above any paths that may be occupied by any Road Runners.
7+
Warnings
8+
--------
9+
Always use proper rigging techniques when hoisting this above
10+
above any paths that may be occupied any Road Runners.
1111
"""
1212

1313
def __init__(self):
@@ -23,20 +23,22 @@ def drop(self):
2323

2424
@property
2525
def weight(self):
26-
"""
27-
The current weight of the piano.
26+
"""The current weight of the piano.
2827
29-
:returns: the current weight.
30-
:rtype: float
28+
Returns
29+
-------
30+
float
31+
the current weight.
3132
"""
3233
return self._weight
3334

3435
@property
3536
def height(self):
36-
"""
37-
The current height of the piano.
37+
"""The current height of the piano.
3838
39-
:returns: the current height.
40-
:rtype: float
39+
Returns
40+
-------
41+
float
42+
the current height.
4143
"""
4244
return self._height

0 commit comments

Comments
 (0)