-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyDocstringTesting.py
More file actions
106 lines (76 loc) · 1.71 KB
/
MyDocstringTesting.py
File metadata and controls
106 lines (76 loc) · 1.71 KB
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
# Sample file for making neatly formatted docstrings
# Based on Sphinx/numpydoc
# When using Spyder, I notice that a host of rich text options are available
# and I want to learn to do this myself
# Testing by creating dummy functions and then checking what their docstrings
# look like in Spyder's object inspector
# See also
# http://matplotlib.org/sampledoc/cheatsheet.html
# Much of it appears similar to the Markdown that I'm familiar with
def basic_formatting():
"""
*italics*, **bold**, ``monotype``
"""
x = 1
return x
def code_block():
"""
Some code::
import numpy as np
x = np.r_[:5]
Note (1) blank line between description and code and (2) double colon.
"""
def headings():
"""
************
Main heading
************
Subheading
==========
Smaller Subheading
------------------
"""
def lists():
"""
Bulleted list
-------------
* Point A
* Point B
Enumerated list
---------------
#. Point one
#. Point two
"""
def parameter_lists():
"""
Returns
-------
out1 :
value without type
out2 : dict
value with type
out3 : no second line
"""
def linebreaks():
"""
| First line
| Second line
| Notice double space
"""
def emphasise():
"""
.. code-block:: python
:emphasize-lines: 3,5
def some_function():
interesting = False
print 'This line is highlighted.'
print 'This one is not...'
print '...but this one is.'
"""
def alternative_parameter_method(one, two):
"""
Inputs
------
:param one: describe one
:param two: describe two
"""