Skip to content

Commit 0c082b1

Browse files
committed
fix the doc build
1 parent 9215278 commit 0c082b1

21 files changed

+192
-150
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
docs/source/auto_examples/
132+
docs/source/gen_modules/
133+
.DS_Store

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ help:
4949

5050
.PHONY: clean
5151
clean:
52-
rm -rf $(BUILDDIR)/*
52+
rm -rf $(BUILDDIR)/* source/gen_modules source/auto_examples
5353

5454
.PHONY: html
5555
html:

docs/source/_templates/class.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{ fullname | escape | underline }}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:special-members: __contains__,__getitem__,__iter__,__len__,__add__,__sub__,__mul__,__div__,__neg__
7+
:members:
8+
9+
.. _sphx_glr_backreferences_{{ fullname }}:
10+
11+
.. minigallery:: {{ fullname }}
12+
:add-heading:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ fullname | escape | underline }}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autofunction:: {{ objname }}
6+
7+
.. _sphx_glr_backreferences_{{ fullname }}:
8+
9+
.. minigallery:: {{ fullname }}
10+
:add-heading:

docs/source/_templates/module.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.. Please when editing this file make sure to keep it matching the
2+
docs in ../configuration.rst:reference_to_examples
3+
14
{{ fullname }}
25
{{ underline }}
36

@@ -13,11 +16,10 @@
1316

1417
.. autofunction:: {{ item }}
1518

16-
.. include:: backreferences/{{fullname}}.{{item}}.examples
17-
18-
.. raw:: html
19+
.. _sphx_glr_backref_{{fullname}}.{{item}}:
1920

20-
<div class="sphx-glr-clear"></div>
21+
.. minigallery:: {{fullname}}.{{item}}
22+
:add-heading:
2123

2224
{%- endfor %}
2325
{% endif %}
@@ -33,11 +35,10 @@
3335
.. autoclass:: {{ item }}
3436
:members:
3537

36-
.. include:: backreferences/{{fullname}}.{{item}}.examples
38+
.. _sphx_glr_backref_{{fullname}}.{{item}}:
3739

38-
.. raw:: html
39-
40-
<div class="sphx-glr-clear"></div>
40+
.. minigallery:: {{fullname}}.{{item}}
41+
:add-heading:
4142

4243
{%- endfor %}
4344
{% endif %}
@@ -54,4 +55,4 @@
5455
{{ item }}
5556
{%- endfor %}
5657
{% endif %}
57-
{% endblock %}
58+
{% endblock %}

docs/source/_templates/versions.html

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

docs/source/all.rst

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,52 @@
44
API and modules
55
===============
66

7-
.. currentmodule:: skada
7+
.. currentmodule:: skada.datasets
88

9+
.. automodule:: skada.datasets
10+
:no-members:
11+
:no-inherited-members:
912

10-
:py:mod:`skada`:
13+
:py:mod:`skada.datasets`:
1114

12-
.. autosummary::
13-
:toctree: gen_modules/
14-
:template: module.rst
15+
.. autosummary::
16+
:toctree: gen_modules/
17+
:template: function.rst
18+
19+
make_shifted_blobs
20+
make_shifted_datasets
21+
make_dataset_from_moons_distribution
22+
make_variable_frequency_dataset
23+
24+
.. currentmodule:: skada.da
25+
26+
.. automodule:: skada.da
27+
:no-members:
28+
:no-inherited-members:
29+
30+
:py:mod:`skada.da`:
31+
32+
.. autosummary::
33+
:toctree: gen_modules/
34+
:template: class.rst
35+
36+
ReweightDensity
37+
GaussianReweightDensity
38+
ClassifierReweightDensity
39+
SubspaceAlignment
40+
TransferComponentAnalysis
41+
42+
.. currentmodule:: skada.deepda
1543

16-
da
17-
deepda
44+
.. automodule:: skada.deepda
45+
:no-members:
46+
:no-inherited-members:
1847

19-
48+
:py:mod:`skada.deepda`:
2049

2150
.. autosummary::
22-
:toctree: ../modules/generated/
23-
:template: module.rst
51+
:toctree: gen_modules/
52+
:template: class.rst
2453

25-
.. automodule:: skada
26-
:members:
54+
DeepCORAL
55+
DeepJDOT

docs/source/conf.py

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,15 @@
88
import sys
99
import os
1010
import re
11+
from numpydoc import numpydoc, docscrape # noqa
1112

12-
try:
13-
import sphinx_gallery
14-
15-
sphinx_gallery.__version__
16-
17-
18-
except ImportError:
19-
print("warning sphinx-gallery not installed")
20-
13+
import sphinx_gallery # noqa
14+
import sphinx_rtd_theme # noqa
2115

2216
# If extensions (or modules to document with autodoc) are in another directory,
2317
# add these directories to sys.path here. If the directory is relative to the
2418
# documentation root, use os.path.abspath to make it absolute, like shown here.
25-
sys.path.insert(0, os.path.abspath("."))
2619
sys.path.insert(0, os.path.abspath(".."))
27-
sys.path.insert(0, os.path.abspath("../.."))
2820

2921

3022
# -- General configuration ------------------------------------------------
@@ -35,23 +27,42 @@
3527
# Add any Sphinx extension module names here, as strings. They can be
3628
# extensions coming with Sphinx (named #'sphinx.ext.*') or your custom
3729
# ones.
30+
# extensions = [
31+
# "sphinx.ext.autodoc",
32+
# "sphinx.ext.autosummary",
33+
# "sphinx.ext.doctest",
34+
# "sphinx.ext.intersphinx",
35+
# # "sphinx.ext.todo",
36+
# "sphinx.ext.coverage",
37+
# "sphinx.ext.mathjax",
38+
# "sphinx.ext.ifconfig",
39+
# "sphinx.ext.viewcode",
40+
# # "sphinx.ext.napoleon",
41+
# "sphinx_gallery.gen_gallery",
42+
# 'numpydoc',
43+
# ]
44+
3845
extensions = [
39-
"sphinx.ext.autodoc",
40-
"sphinx.ext.autosummary",
41-
"sphinx.ext.doctest",
42-
"sphinx.ext.intersphinx",
43-
"sphinx.ext.todo",
44-
"sphinx.ext.coverage",
45-
"sphinx.ext.mathjax",
46-
"sphinx.ext.ifconfig",
47-
"sphinx.ext.viewcode",
48-
"sphinx.ext.napoleon",
49-
"sphinx_gallery.gen_gallery",
46+
'sphinx.ext.autodoc',
47+
# 'sphinx.ext.napoleon',
48+
'numpydoc',
49+
'sphinx.ext.viewcode',
50+
'sphinx.ext.autosummary',
51+
'sphinx.ext.doctest',
52+
'sphinx.ext.intersphinx',
53+
'sphinx.ext.todo',
54+
'sphinx.ext.coverage',
55+
'sphinx.ext.mathjax',
56+
'sphinx_gallery.gen_gallery',
57+
'sphinx.ext.graphviz',
5058
]
5159

60+
# autodoc / autosummary
5261
autosummary_generate = True
62+
# autodoc_default_options = {'inherited-members': None}
63+
numpydoc_show_class_members = False
5364

54-
napoleon_numpy_docstring = True
65+
# napoleon_numpy_docstring = True
5566

5667
# Add any paths that contain templates here, relative to this directory.
5768
templates_path = ["_templates"]
@@ -68,7 +79,7 @@
6879
master_doc = "index"
6980

7081
# General information about the project.
71-
project = ""
82+
project = "SKADA"
7283
copyright = "2022, The SKADA team"
7384
author = "Théo Gnassounou, Rémi Flamary, Alexandre Gramfort"
7485

@@ -101,7 +112,7 @@
101112

102113
# List of patterns, relative to source directory, that match files and
103114
# directories to ignore when looking for source files.
104-
exclude_patterns = []
115+
exclude_patterns = ['build']
105116

106117
# The reST default role (used for this markup: `text`) to use for all
107118
# documents.
@@ -120,6 +131,7 @@
120131

121132
# The name of the Pygments (syntax highlighting) style to use.
122133
pygments_style = "default"
134+
highlight_language = 'python3'
123135

124136
# A list of ignored prefixes for module index sorting.
125137
# modindex_common_prefix = []
@@ -165,6 +177,7 @@
165177
# Add any paths that contain custom static files (such as style sheets) here,
166178
# relative to this directory. They are copied after the builtin static files,
167179
# so a file named "default.css" will overwrite the builtin "default.css".
180+
# html_static_path = []
168181
html_static_path = ["_static"]
169182
# html_css_files = ["css/custom.css"]
170183

@@ -316,19 +329,19 @@
316329
# Example configuration for intersphinx: refer to the Python standard library.
317330
intersphinx_mapping = {
318331
"python": ("https://docs.python.org/3", None),
319-
"numpy": ("http://docs.scipy.org/doc/numpy/", None),
320-
"scipy": ("http://docs.scipy.org/doc/scipy/reference/", None),
321-
"matplotlib": ("http://matplotlib.org/", None),
322-
"torch": ("https://pytorch.org/docs/stable/", None),
332+
# "numpy": ("http://docs.scipy.org/doc/numpy/", None),
333+
# "scipy": ("http://docs.scipy.org/doc/scipy/reference/", None),
334+
# "matplotlib": ("http://matplotlib.org/", None),
335+
# "torch": ("https://pytorch.org/docs/stable/", None),
323336
}
324337

325338
sphinx_gallery_conf = {
326-
"examples_dirs": ["../../examples", "../../examples/da"],
339+
"examples_dirs": ["../../examples"],
327340
"gallery_dirs": "auto_examples",
328341
"nested_sections": False,
329342
"backreferences_dir": "gen_modules/backreferences",
330343
"inspect_global_variables": True,
331-
"doc_module": ("ot", "numpy", "scipy", "pylab"),
344+
"doc_module": ("skada", "ot", "numpy", "scipy", "pylab"),
332345
"matplotlib_animations": True,
333346
"reference_url": {"skada": None},
334347
}

examples/README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Examples gallery
44
This is a gallery of all the SKADA example files.
55

66

7-
Domai Adaptation Examples
8-
-------------------------
7+
Domain Adaptation Examples
8+
--------------------------

examples/plot_dataset_from_moons_distribution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
====================================================
32
Plot dataset source domain and shifted target domain
43
====================================================
4+
55
This illustrates the :func:`~skada.datasets.make_dataset_from_moons_distribution`
66
dataset generator. Each method consists of generating source data
77
and shifted target data.

0 commit comments

Comments
 (0)