-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocumentation_template.py
110 lines (81 loc) · 1.72 KB
/
documentation_template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
"""
******
module name
******
Short module descritpion.
long
module
description
if
needed
@author:
"""
import sys
__all__ = ["function1", "function2", "function3", "etc."]
def function1(bla, bla1, bla2):
return "beginning of the module"
class doc(object): # long version
"""
doc(param1, param2=None, ...)
A documentation.....
For more information, refer to.....
Parameters
----------
param1 : description
param2 : description
Attributes
----------
A1 : type object
Description...
attr2 : type
Description...
attr3 : type object
Describes... the format of the elements in the array.
See Also
--------
otherObject1 : Construct something....
otherObject2 : construct something....
Notes
-----
There are n mode(s) of using doc.....
Examples
--------
First example :
>>>
Second example :
>>>
"""
def short_method(self, p1="aaa", p2=None): # short version
"""
r.short_method(p1="bbb", p2=True)
Returns ............
Examples
--------
>>>
"""
pass
def random_function(p1, p2=2, p3=1.0, p4=None): # long version
"""
What the function does, briefly.
larger description and if needed.
modules required if any
Parameters
----------
p1 : Type
Description
p2, p3, ... : Type, (optional)
Description of parameters.
Returns
-------
r1 : type
Description
Examples
--------
>>> p1 = foo
>>> resu = random_function(p1)
Notes
-----
Important notes if any.
"""
import numpy as np # modules can be imported in functions
return r1