Skip to content

Commit 4701260

Browse files
committed
doc: move to sphinx gallery (#8)
* doc: move to sphinx gallery * doc: auto generate toc-tree for flow submodule * doc: gitignore generated examples * doc: remove generated examples
1 parent 4c7b72a commit 4701260

35 files changed

Lines changed: 487 additions & 1045 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
.spyproject/
55
__pycache__/
66
docs/build/
7+
docs/source/generated/
8+
docs/source/examples/
79
info/
810
#_build
911
#_static

anaflow/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Homogeneous
2020
^^^^^^^^^^^
2121
22-
.. currentmodule:: anaflow.flow.homogeneous
22+
.. currentmodule:: anaflow.flow
2323
2424
Solutions for homogeneous aquifers
2525
@@ -31,8 +31,6 @@
3131
Heterogeneous
3232
^^^^^^^^^^^^^
3333
34-
.. currentmodule:: anaflow.flow.heterogeneous
35-
3634
Solutions for heterogeneous aquifers
3735
3836
.. autosummary::
@@ -50,8 +48,6 @@
5048
Extended GRF
5149
^^^^^^^^^^^^
5250
53-
.. currentmodule:: anaflow.flow.ext_grf_model
54-
5551
The extended general radial flow model.
5652
5753
.. autosummary::

anaflow/flow/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
.. currentmodule:: anaflow.flow
99
1010
.. autosummary::
11-
homogeneous
12-
heterogeneous
13-
ext_grf_model
1411
laplace
1512
1613
Solutions
@@ -19,42 +16,42 @@
1916
Homogeneous
2017
~~~~~~~~~~~
2118
22-
.. currentmodule:: anaflow.flow.homogeneous
23-
2419
Solutions for homogeneous aquifers
2520
2621
.. autosummary::
22+
:toctree: generated
23+
2724
thiem
2825
theis
2926
grf
3027
3128
Heterogeneous
3229
~~~~~~~~~~~~~
3330
34-
.. currentmodule:: anaflow.flow.heterogeneous
35-
3631
Solutions for heterogeneous aquifers
3732
3833
.. autosummary::
34+
:toctree: generated
35+
3936
ext_thiem_2d
4037
ext_thiem_3d
4138
ext_thiem_tpl
4239
ext_thiem_tpl_3d
4340
ext_theis_2d
4441
ext_theis_3d
4542
ext_theis_tpl
46-
ext_thiem_tpl_3d
43+
ext_theis_tpl_3d
4744
neuman2004
4845
neuman2004_steady
4946
5047
Extended GRF
5148
~~~~~~~~~~~~
5249
53-
.. currentmodule:: anaflow.flow.ext_grf_model
54-
5550
The extended general radial flow model.
5651
5752
.. autosummary::
53+
:toctree: generated
54+
5855
ext_grf
5956
ext_grf_steady
6057
"""

docs/source/conf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def setup(app):
5454
"sphinx.ext.autosummary",
5555
"sphinx.ext.napoleon", # parameters look better than with numpydoc only
5656
"numpydoc",
57+
"sphinx_gallery.gen_gallery",
5758
]
5859

5960
# autosummaries from source-files
@@ -242,3 +243,30 @@ def setup(app):
242243
"NumPy": ("http://docs.scipy.org/doc/numpy/", None),
243244
"SciPy": ("http://docs.scipy.org/doc/scipy/reference", None),
244245
}
246+
247+
# -- Sphinx Gallery Options
248+
from sphinx_gallery.sorting import FileNameSortKey
249+
250+
sphinx_gallery_conf = {
251+
# only show "print" output as output
252+
"capture_repr": (),
253+
# path to your examples scripts
254+
"examples_dirs": ["../../examples"],
255+
# path where to save gallery generated examples
256+
"gallery_dirs": ["examples"],
257+
# Pattern to search for example files
258+
"filename_pattern": "/.*.py",
259+
# "ignore_pattern": "",
260+
# Remove the "Download all examples" button from the top level gallery
261+
"download_all_examples": False,
262+
# Sort gallery example by file name instead of number of lines (default)
263+
"within_subsection_order": FileNameSortKey,
264+
# directory where function granular galleries are stored
265+
"backreferences_dir": None,
266+
# Modules for which function level galleries are created. In
267+
"doc_module": "AnaFlow",
268+
# "image_scrapers": ('pyvista', 'matplotlib'),
269+
# "first_notebook_cell": ("%matplotlib inline\n"
270+
# "from pyvista import set_plot_theme\n"
271+
# "set_plot_theme('document')"),
272+
}

docs/source/contents.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Contents
77
:maxdepth: 3
88

99
index
10-
tutorials
10+
examples/index
1111
package

docs/source/flow.ext_grf_model.rst

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

docs/source/flow.heterogeneous.rst

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

docs/source/flow.homogeneous.rst

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

docs/source/flow.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@ anaflow.flow
1010
.. toctree::
1111
:hidden:
1212

13-
flow.homogeneous.rst
14-
flow.heterogeneous.rst
15-
flow.ext_grf_model.rst
1613
flow.laplace.rst

docs/source/tutorial_01_call.rst

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

0 commit comments

Comments
 (0)