Skip to content

Commit 2dc9b90

Browse files
wdevazelhesbellet
authored andcommitted
[MRG] Enhance documentation (#208)
* Add link to algorithm in the title of sections * Separate supervised and weakly supervised algorithms in Package Overview * Improve doc * Fix plot_metric_example * Update links with the new pages * Use random init for LMNN * Update remaining num_dims * Add description of the API for Weakly Supervised and Supervised algorithms * Remove to have the list of methods in the description of the class * Fix: Update wronly merged lmnn with None instead of 'auto' in init * Add some documentation about generating pairs and quadruplets * Add base module quick description * Put classes rather than modules * Add docstrings at top of algos * Update name of API details to Package Contents * Update name of API details to Package Contents
1 parent 580d38d commit 2dc9b90

33 files changed

+1708
-1349
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ htmlcov/
77
.cache/
88
.pytest_cache/
99
doc/auto_examples/*
10+
doc/generated/*

doc/_templates/class.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:mod:`{{module}}`.{{objname}}
2+
{{ underline }}==============
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autoclass:: {{ objname }}
7+
:members:
8+
:undoc-members:
9+
:inherited-members:
10+
:special-members: __init__
11+
12+
.. include:: {{module}}.{{objname}}.examples
13+
14+
.. raw:: html
15+
16+
<div style='clear:both'></div>

doc/conf.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import sys
3+
import os
34

45
extensions = [
56
'sphinx.ext.autodoc',
@@ -28,7 +29,6 @@
2829
exclude_patterns = ['_build']
2930
pygments_style = 'sphinx'
3031
todo_include_todos = True
31-
numpydoc_show_class_members = False
3232

3333
# Options for HTML output
3434
html_theme = 'sphinx_rtd_theme'
@@ -50,3 +50,16 @@
5050
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
5151
'scikit-learn': ('https://scikit-learn.org/stable/', None)
5252
}
53+
54+
55+
# sphinx-gallery configuration
56+
sphinx_gallery_conf = {
57+
# to generate mini-galleries at the end of each docstring in the API
58+
# section: (see https://sphinx-gallery.github.io/configuration.html
59+
# #references-to-examples)
60+
'doc_module': 'metric_learn',
61+
'backreferences_dir': os.path.join('generated'),
62+
}
63+
64+
# generate autosummary even if no references
65+
autosummary_generate = True

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Documentation outline
2525
.. toctree::
2626
:maxdepth: 2
2727

28-
Package Overview <metric_learn>
28+
Package Contents <metric_learn>
2929

3030
.. toctree::
3131
:maxdepth: 2

doc/metric_learn.base_metric.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/metric_learn.constraints.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/metric_learn.covariance.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.

doc/metric_learn.itml.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

doc/metric_learn.lfda.rst

Lines changed: 0 additions & 31 deletions
This file was deleted.

doc/metric_learn.lmnn.rst

Lines changed: 0 additions & 34 deletions
This file was deleted.

doc/metric_learn.lsml.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

doc/metric_learn.mlkr.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

doc/metric_learn.mmc.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

doc/metric_learn.nca.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

doc/metric_learn.rca.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)