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 #509

Merged
merged 33 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
22e1c85
start sphinx gallery
clewis7 May 29, 2024
71c1eaf
relevant file changes
clewis7 May 29, 2024
c8eb15d
progress
clewis7 May 30, 2024
e97f37b
edit setup.py to include missing dependencies
clewis7 May 30, 2024
5e0d08c
attempt to fix rtd
clewis7 May 30, 2024
1acbbfb
remove large heatmap example that breaks rtd
clewis7 May 30, 2024
372e466
fix linter, attempt to fix quickstart bug
clewis7 May 30, 2024
b4dbc94
fix gridplot examples and gallery structure
clewis7 Jun 3, 2024
0fc05dd
remove nbsphinx
clewis7 Jun 4, 2024
2856365
remove nbsphinx and quickstart.ipynb from docs
clewis7 Jun 4, 2024
dacc382
remove init files from examples
clewis7 Jun 4, 2024
985eb2e
update examples and conf.py
clewis7 Jun 5, 2024
79b6e7f
add animation examples, edit conf.py, fix scatter examples
clewis7 Jun 5, 2024
9c447de
add sklearn to docs, example needs it
clewis7 Jun 5, 2024
c92e5b7
Update setup.py
clewis7 Jun 5, 2024
676a481
Update setup.py
clewis7 Jun 5, 2024
09acb24
remove from gallery, kills readthedocs runner
clewis7 Jun 5, 2024
f749ef3
update canvas size so thumbnails render better
clewis7 Jun 5, 2024
59ec3fb
change scatter examples, remove sklearn from docs dependencies
clewis7 Jun 5, 2024
d0852f4
add iris scatter examples, exclude from screenshot tests
clewis7 Jun 5, 2024
7efad6b
add more animation examples, add to tests
clewis7 Jun 5, 2024
16c712c
add simple multigraphic gridplot example
clewis7 Jun 5, 2024
98d5280
add simple event, fix multigraphic gridplot
clewis7 Jun 6, 2024
ff3f429
Update line3d_animation.py
clewis7 Jun 6, 2024
1fba2c4
add simple event example
clewis7 Jun 6, 2024
3ff1982
resolve merge conflicts, change fig to figure for gallery
clewis7 Jun 17, 2024
26d85e4
minor changes
clewis7 Jun 18, 2024
ea298dc
replace screenshots and fix small bug
clewis7 Jun 18, 2024
950d4b4
fix scatter examples for CI build
clewis7 Jun 18, 2024
64aaca7
fix screenshots
clewis7 Jun 18, 2024
27c90aa
add sklearn as docs dependency, include iris scatter examples in gallery
clewis7 Jun 18, 2024
ee2d8f1
Update examples/desktop/misc/simple_event.py
clewis7 Jun 18, 2024
0e199ea
update screenshots
clewis7 Jun 18, 2024
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
54 changes: 51 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os

# need to force offscreen rendering before importing fpl
# otherwise fpl tries to select glfw canvas
os.environ["WGPU_FORCE_OFFSCREEN"] = "1"
clewis7 marked this conversation as resolved.
Show resolved Hide resolved

import fastplotlib
from pygfx.utils.gallery_scraper import find_examples_for_gallery
from pathlib import Path
import sys
from sphinx_gallery.sorting import ExplicitOrder
import imageio.v3 as iio

ROOT_DIR = Path(__file__).parents[1].parents[0] # repo root
EXAMPLES_DIR = Path.joinpath(ROOT_DIR, "examples", "desktop")

sys.path.insert(0, str(ROOT_DIR))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Expand All @@ -23,9 +40,40 @@
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_design",
"nbsphinx",
"sphinx_gallery.gen_gallery"
]

sphinx_gallery_conf = {
"gallery_dirs": "_gallery",
"backreferences_dir": "_gallery/backreferences",
"doc_module": ("fastplotlib",),
"image_scrapers": ("pygfx",),
"remove_config_comments": True,
"subsection_order": ExplicitOrder(
[
"../../examples/desktop/image",
"../../examples/desktop/gridplot",
"../../examples/desktop/line",
"../../examples/desktop/line_collection",
"../../examples/desktop/scatter",
"../../examples/desktop/heatmap",
"../../examples/desktop/misc"
]
),
"ignore_pattern": r'__init__\.py',
"nested_sections": False,
"thumbnail_size": (250, 250)
}

extra_conf = find_examples_for_gallery(EXAMPLES_DIR)
sphinx_gallery_conf.update(extra_conf)

# download imageio examples for the gallery
iio.imread("imageio:clock.png")
iio.imread("imageio:astronaut.png")
iio.imread("imageio:coffee.png")
iio.imread("imageio:hubble_deep_field.png")

autosummary_generate = True

templates_path = ["_templates"]
Expand All @@ -52,12 +100,12 @@
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pygfx": ("https://pygfx.readthedocs.io/en/latest", None),
"pygfx": ("https://pygfx.com/stable/", None),
"wgpu": ("https://wgpu-py.readthedocs.io/en/latest", None),
}

html_theme_options = {
"source_repository": "https://github.com/kushalkolar/fastplotlib",
"source_repository": "https://github.com/fastplotlib/fastplotlib",
"source_branch": "main",
"source_directory": "docs/",
}
12 changes: 6 additions & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
Welcome to fastplotlib's documentation!
=======================================

.. toctree::
:caption: Quick Start
:maxdepth: 2

quickstart

.. toctree::
:caption: User Guide
:maxdepth: 2
Expand All @@ -26,6 +20,12 @@ Welcome to fastplotlib's documentation!
Utils <api/utils>
GPU <api/gpu>

.. toctree::
:caption: Gallery
:maxdepth: 1

Gallery <_gallery/index>

Summary
=======

Expand Down
Loading
Loading