Skip to content

Commit

Permalink
doc improve links intersphinx + sphinx gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Jan 24, 2021
1 parent 4a93705 commit 84e0dc7
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
.pytest_cache/
docs/generated
docs/auto_examples
.vscode/


# Byte-compiled / optimized / DLL files
Expand Down
12 changes: 12 additions & 0 deletions docs/_templates/autosummary/class.rst
@@ -0,0 +1,12 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:special-members: __contains__,__getitem__,__iter__,__len__,__add__,__sub__,__mul__,__div__,__neg__,__hash__
:members:

.. _sphx_glr_backreferences_{{ fullname }}:

.. minigallery:: {{ fullname }}
:add-heading:
10 changes: 7 additions & 3 deletions docs/api.rst
Expand Up @@ -8,12 +8,16 @@ API Documentation

Here we list the Application Programming Interface (API) for remedian.

.. currentmodule:: remedian

The :class:`Remedian` class
----------------------------

.. automodule:: remedian
:no-members:
:no-inherited-members:

.. currentmodule:: remedian

.. autosummary::
:toctree: generated/

Remedian
Remedian.add_obs
10 changes: 8 additions & 2 deletions docs/conf.py
Expand Up @@ -3,7 +3,6 @@
import sys
from datetime import date

import sphinx_gallery # noqa: F401
import sphinx_bootstrap_theme

import remedian
Expand Down Expand Up @@ -33,14 +32,19 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
'sphinx.ext.viewcode',
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
'numpydoc',
'sphinx_gallery.gen_gallery',
]

master_doc = "index"
autosummary_generate = True

# configure numpydoc
numpydoc_xref_param_type = True
numpydoc_show_class_members = False # noqa: E501 https://stackoverflow.com/a/34604043/5201771

# List of patterns, relative to source directory, that match files and
Expand All @@ -56,6 +60,8 @@
html_theme = "bootstrap"
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()

templates_path = ["_templates"]


# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
6 changes: 4 additions & 2 deletions examples/pros_cons_remedian.py
Expand Up @@ -3,14 +3,16 @@
Pros and Cons of Remedian
=========================
.. currentmodule:: remedian
In this example we test :class:`remedian.Remedian` against :func:`numpy.median`
in terms of three parameters:
- computation time
- mean squared error compared to true median
- memory needed for computation
"""
""" # noqa: D205 D400

# Authors: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
# License: MIT
Expand Down Expand Up @@ -92,7 +94,7 @@
for ax, name, result in zip(axs, names, results):

ax.plot(n_obses, result[0, ...], label='data_unif')
ax.plot(n_obses, result[1, ...], label='data_norm')
ax.plot(n_obses, result[1, ...], label='data_norm', linestyle='--')
ax.axvline(n_obses[-1], color='black', linestyle='--',
label='*true* median')

Expand Down
4 changes: 3 additions & 1 deletion examples/use_remedian.py
Expand Up @@ -3,10 +3,12 @@
Use Remedian
============
.. currentmodule:: remedian
This example exists to demonstrate the basic usage of
:class:`remedian.Remedian`.
"""
""" # noqa: D205 D400

# Authors: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
# License: MIT
Expand Down

0 comments on commit 84e0dc7

Please sign in to comment.