Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx gallery #63

Merged
merged 9 commits into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,15 @@ info/

# Cython generated C code
*.c
*.cpp


docs/source/examples/


*.DS_Store

*.zip

*.vtu
*.vtr
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ print(gstools.__version__)

Open a [new issue](https://github.com/GeoStat-Framework/GSTools/issues)
with your idea or suggestion and we'd love to discuss about it.


## Do you want to enhance GSTools or fix something?

- Fork the repo on [GitHub](https://github.com/GeoStat-Framework/GSTools).
- Add yourself to AUTHORS.md (if you want to).
- We use the black code format, please use the script `black --line-length 79 gstools/` after you have written your code.
- Add some tests if possible.
- Add an example showing your new feature in one of the examples sub-folders if possible.
Follow this [Sphinx-Gallary guide](https://sphinx-gallery.github.io/stable/syntax.html#embed-rst-in-your-example-python-files)
- Push to your fork and submit a pull request.
5 changes: 4 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
cython>=0.28.3
numpydoc
# https://stackoverflow.com/a/11704396/6696397
-r ../requirements.txt
-r ../requirements.txt
sphinx-gallery
matplotlib
pykrige
55 changes: 53 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
# NOTE:
# pip install sphinx_rtd_theme
# is needed in order to build the documentation
import os
import sys
# import os
# import sys
import warnings
warnings.filterwarnings(
"ignore",
category=UserWarning,
message='Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.',
)

# local module should not be added to sys path if it's installed on RTFD
# see: https://stackoverflow.com/a/31882049/6696397
Expand Down Expand Up @@ -59,6 +65,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 @@ -247,3 +254,47 @@ def setup(app):
"hankel": ("https://hankel.readthedocs.io/en/latest/", None),
"emcee": ("https://emcee.readthedocs.io/en/latest/", None),
}



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

sphinx_gallery_conf = {
# path to your examples scripts
"examples_dirs": [
"../../examples/00_misc/",
"../../examples/01_random_field/",
"../../examples/02_cov_model/",
"../../examples/03_variogram/",
"../../examples/04_vector_field/",
"../../examples/05_kriging/",
"../../examples/06_conditioned_fields/",
"../../examples/07_transformations/",
],
# path where to save gallery generated examples
"gallery_dirs": [
"examples/00_misc/",
"examples/01_random_field/",
"examples/02_cov_model/",
"examples/03_variogram/",
"examples/04_vector_field/",
"examples/05_kriging/",
"examples/06_conditioned_fields/",
"examples/07_transformations/",
],
# Pattern to search for example files
"filename_pattern": r"\.py",
# 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": "gstools",
#"image_scrapers": ('pyvista', 'matplotlib'),
# 'first_notebook_cell': ("%matplotlib inline\n"
# "from pyvista import set_plot_theme\n"
# "set_plot_theme('document')"),
}
281 changes: 0 additions & 281 deletions docs/source/tutorial_01_srf.rst

This file was deleted.

Loading