Skip to content

Commit 2f73838

Browse files
committed
Improve API documentation
1 parent d6f7187 commit 2f73838

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
def autoapi_skip_member(app, what, name, obj, skip, options):
4444
skip |= ".. deprecated::" in obj.docstring
45+
skip |= ":nodoc:" in obj.docstring
46+
skip |= not obj.docstring and what == "data" # undocumented variables
4547
return skip
4648

4749

xplt/colors.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,31 @@
3131
"#717581",
3232
"#92dadd",
3333
]
34+
"""List of 10 accessible and aesthetic colors selected by M. A. Petroff"""
3435

35-
#: Colormap with 10 distinct colors
3636
cmap_petroff = mpl.colors.ListedColormap(petroff_colors, "petroff")
37+
"""Colormap with 10 distinct colors"""
3738
cmap_petroff.set_under("none")
3839
cmap_petroff.set_over("none")
3940

40-
#: Gradient colormap
4141
cmap_petroff_gradient = mpl.colors.LinearSegmentedColormap.from_list(
4242
"petroff_gradient", [petroff_colors[i] for i in (9, 0, 4, 2, 6, 1)]
4343
)
44+
"""Gradient colormap"""
4445
cmap_petroff_gradient.set_under(petroff_colors[3])
4546
cmap_petroff_gradient.set_over(petroff_colors[7])
4647

47-
#: Bipolar colormap
4848
cmap_petroff_bipolar = mpl.colors.LinearSegmentedColormap.from_list(
4949
"petroff_bipolar", [petroff_colors[i] for i in (2, 6, 1, 3, 9, 0, 4)]
5050
)
51+
"""Bipolar colormap"""
5152
cmap_petroff_bipolar.set_under(petroff_colors[5])
5253
cmap_petroff_bipolar.set_over(petroff_colors[8])
5354

54-
#: Cyclic colormap
5555
cmap_petroff_cyclic = mpl.colors.LinearSegmentedColormap.from_list(
5656
"petroff_cyclic", [petroff_colors[i] for i in (3, 9, 0, 4, 2, 6, 1, 3)]
5757
)
58+
"""Cyclic colormap"""
5859

5960

6061
def make_unicoloured_cmap(color):

xplt/util.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@
2323

2424

2525
def PUBLIC_SECTION_BEGIN():
26-
"""Starting from here, collect objects to be included in file's `__all__` magic"""
26+
"""Starting from here, collect objects to be included in file's `__all__` magic
27+
28+
:nodoc:
29+
"""
2730
g = inspect.stack()[1].frame.f_globals
2831
g["__private_names"] = set(g.keys()).union(["__private_names"])
2932

3033

3134
def PUBLIC_SECTION_END():
32-
"""Finish object collection and return global names for the `__all__` magic"""
35+
"""Finish object collection and return global names for the `__all__` magic
36+
37+
:nodoc:
38+
"""
3339
g = inspect.stack()[1].frame.f_globals
3440
public = list(set(g.keys()).difference(g["__private_names"]))
3541
return public[:] # copy needed for it to work with sphinx autoapi
@@ -38,7 +44,8 @@ def PUBLIC_SECTION_END():
3844
VOID = object()
3945

4046

41-
c0 = 299792458 # speed of light in m/s
47+
c0 = 299792458
48+
"""Speed of light in m/s"""
4249

4350

4451
def val(obj):

0 commit comments

Comments
 (0)