Skip to content

DOC: Use napoleon sphinx extension #5743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ install:
# Neihter is installed as a dependency of IPython since they are not used by the IPython console.
- |
if [[ $BUILD_DOCS == true ]]; then
pip install $PRE numpydoc ipython jsonschema mistune colorspacious
pip install $PRE ipython jsonschema mistune colorspacious
pip install -q $PRE linkchecker
wget https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O Felipa-Regular.ttf
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb
Expand Down
9 changes: 4 additions & 5 deletions doc/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ python documentation system built on top of ReST. This directory contains
* mpl_examples - a link to the matplotlib examples in case any
documentation wants to literal include them

To build the HTML documentation, install sphinx (1.0 or greater
required), then type "python make.py html" in this directory. Wait
for the initial run (which builds the example gallery) to be done,
then run "python make.py html" again. The top file of the results will
be ./build/html/index.html
To build the HTML documentation, install sphinx (1.0 or greater required) and,
if sphinx older than 1.3, sphinxcontrib-napoleon, then type "python make.py
html" in this directory. The top file of the results will be
./build/html/index.html

Note that Sphinx uses the installed version of the package to build
the documentation, so matplotlib must be installed *before* the docs
Expand Down
17 changes: 8 additions & 9 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
'sphinx.ext.inheritance_diagram',
'sphinxext.gen_gallery', 'sphinxext.gen_rst',
'sphinxext.github',
'numpydoc']
]
if hasattr(sphinx, 'version_info') and sphinx.version_info[:2] >= (1, 3):
extensions += ['sphinx.ext.napoleon']
else:
extensions += ['sphinxcontrib.napoleon']

exclude_patterns = ['api/api_changes/*', 'users/whats_new/*']

Expand All @@ -46,12 +50,6 @@
extensions.append('IPython.sphinxext.ipython_console_highlighting')
extensions.append('IPython.sphinxext.ipython_directive')

try:
import numpydoc
except ImportError:
raise ImportError("No module named numpydoc - you need to install "
"numpydoc to build the documentation.")


autosummary_generate = True

Expand Down Expand Up @@ -333,5 +331,6 @@ def getapi(*args):
sys.modules['sip'] = mocksip
sys.modules['PyQt4'] = mockpyqt4

################# numpydoc config ####################
numpydoc_show_class_members = False
################# napoleon config ####################
napoleon_google_docstring = False
napoleon_use_param = False
2 changes: 1 addition & 1 deletion doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def htmlhelp():
with open('build/htmlhelp/index.html', 'r+') as fh:
content = fh.read()
fh.seek(0)
content = re.sub(r'<script>.*?</script>', '', content,
content = re.sub(r'<script>.*?</script>', '', content,
flags=re.MULTILINE| re.DOTALL)
fh.write(content)
fh.truncate()
Expand Down
18 changes: 7 additions & 11 deletions lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,6 @@ def pickable(self):

def pick(self, mouseevent):
"""
call signature::

pick(mouseevent)

each child artist will fire a pick event if *mouseevent* is over
the artist and the artist has picker set
"""
Expand Down Expand Up @@ -573,17 +569,17 @@ def get_sketch_params(self):
-------
sketch_params : tuple or `None`

A 3-tuple with the following elements:
A 3-tuple with the following elements:

* `scale`: The amplitude of the wiggle perpendicular to the
source line.
* `scale`: The amplitude of the wiggle perpendicular to the
source line.

* `length`: The length of the wiggle along the line.
* `length`: The length of the wiggle along the line.

* `randomness`: The scale factor by which the length is
shrunken or expanded.
* `randomness`: The scale factor by which the length is
shrunken or expanded.

May return `None` if no sketch parameters were set.
May return `None` if no sketch parameters were set.
"""
return self._sketch

Expand Down
Loading