Skip to content

Commit

Permalink
doc: move to sphinx gallery (#8)
Browse files Browse the repository at this point in the history
* doc: move to sphinx gallery

* doc: auto generate toc-tree for flow submodule

* doc: gitignore generated examples

* doc: remove generated examples
  • Loading branch information
MuellerSeb committed Apr 16, 2023
1 parent 4c7b72a commit 4701260
Show file tree
Hide file tree
Showing 35 changed files with 487 additions and 1,045 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
.spyproject/
__pycache__/
docs/build/
docs/source/generated/
docs/source/examples/
info/
#_build
#_static
Expand Down
6 changes: 1 addition & 5 deletions anaflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Homogeneous
^^^^^^^^^^^
.. currentmodule:: anaflow.flow.homogeneous
.. currentmodule:: anaflow.flow
Solutions for homogeneous aquifers
Expand All @@ -31,8 +31,6 @@
Heterogeneous
^^^^^^^^^^^^^
.. currentmodule:: anaflow.flow.heterogeneous
Solutions for heterogeneous aquifers
.. autosummary::
Expand All @@ -50,8 +48,6 @@
Extended GRF
^^^^^^^^^^^^
.. currentmodule:: anaflow.flow.ext_grf_model
The extended general radial flow model.
.. autosummary::
Expand Down
17 changes: 7 additions & 10 deletions anaflow/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
.. currentmodule:: anaflow.flow
.. autosummary::
homogeneous
heterogeneous
ext_grf_model
laplace
Solutions
Expand All @@ -19,42 +16,42 @@
Homogeneous
~~~~~~~~~~~
.. currentmodule:: anaflow.flow.homogeneous
Solutions for homogeneous aquifers
.. autosummary::
:toctree: generated
thiem
theis
grf
Heterogeneous
~~~~~~~~~~~~~
.. currentmodule:: anaflow.flow.heterogeneous
Solutions for heterogeneous aquifers
.. autosummary::
:toctree: generated
ext_thiem_2d
ext_thiem_3d
ext_thiem_tpl
ext_thiem_tpl_3d
ext_theis_2d
ext_theis_3d
ext_theis_tpl
ext_thiem_tpl_3d
ext_theis_tpl_3d
neuman2004
neuman2004_steady
Extended GRF
~~~~~~~~~~~~
.. currentmodule:: anaflow.flow.ext_grf_model
The extended general radial flow model.
.. autosummary::
:toctree: generated
ext_grf
ext_grf_steady
"""
Expand Down
28 changes: 28 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def setup(app):
"sphinx.ext.autosummary",
"sphinx.ext.napoleon", # parameters look better than with numpydoc only
"numpydoc",
"sphinx_gallery.gen_gallery",
]

# autosummaries from source-files
Expand Down Expand Up @@ -242,3 +243,30 @@ def setup(app):
"NumPy": ("http://docs.scipy.org/doc/numpy/", None),
"SciPy": ("http://docs.scipy.org/doc/scipy/reference", None),
}

# -- Sphinx Gallery Options
from sphinx_gallery.sorting import FileNameSortKey

sphinx_gallery_conf = {
# only show "print" output as output
"capture_repr": (),
# path to your examples scripts
"examples_dirs": ["../../examples"],
# path where to save gallery generated examples
"gallery_dirs": ["examples"],
# Pattern to search for example files
"filename_pattern": "/.*.py",
# "ignore_pattern": "",
# Remove the "Download all examples" button from the top level gallery
"download_all_examples": False,
# Sort gallery example by file name instead of number of lines (default)
"within_subsection_order": FileNameSortKey,
# directory where function granular galleries are stored
"backreferences_dir": None,
# Modules for which function level galleries are created. In
"doc_module": "AnaFlow",
# "image_scrapers": ('pyvista', 'matplotlib'),
# "first_notebook_cell": ("%matplotlib inline\n"
# "from pyvista import set_plot_theme\n"
# "set_plot_theme('document')"),
}
2 changes: 1 addition & 1 deletion docs/source/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Contents
:maxdepth: 3

index
tutorials
examples/index
package
11 changes: 0 additions & 11 deletions docs/source/flow.ext_grf_model.rst

This file was deleted.

11 changes: 0 additions & 11 deletions docs/source/flow.heterogeneous.rst

This file was deleted.

11 changes: 0 additions & 11 deletions docs/source/flow.homogeneous.rst

This file was deleted.

3 changes: 0 additions & 3 deletions docs/source/flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@ anaflow.flow
.. toctree::
:hidden:

flow.homogeneous.rst
flow.heterogeneous.rst
flow.ext_grf_model.rst
flow.laplace.rst
32 changes: 0 additions & 32 deletions docs/source/tutorial_01_call.rst

This file was deleted.

59 changes: 0 additions & 59 deletions docs/source/tutorial_02_extended_theis.rst

This file was deleted.

65 changes: 0 additions & 65 deletions docs/source/tutorial_03_extended_theis3d.rst

This file was deleted.

Loading

0 comments on commit 4701260

Please sign in to comment.