Skip to content

Commit

Permalink
Attempt at using gallery v2
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Mar 16, 2023
1 parent 2be7841 commit ee38869
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py)$"
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py)$"
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build:
python: "mambaforge-4.10"
apt_packages:
- xvfb
- libgl1-mesa-dev

conda:
environment: .rtd-environment.yml
Expand Down
30 changes: 18 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
"""
Configuration file for the Sphinx documentation builder.
"""
import warnings
import numpy as np
import pyvista

# Use the sunpy theme
from sunpy_sphinx_theme.conf import *
from packaging.version import Version
from sunkit_pyvista import __version__
import os
from datetime import datetime

from packaging.version import Version
from sunpy_sphinx_theme.conf import *

from sunkit_pyvista import __version__

# -- Project information -----------------------------------------------------
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
os.environ["HIDE_PARFIVE_PROGESS"] = "True"
Expand Down Expand Up @@ -41,7 +39,6 @@
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
# "jupyter_sphinx",
]

# List of patterns, relative to source directory, that match files and
Expand Down Expand Up @@ -87,14 +84,22 @@
}

# -- pyvista configuration ---------------------------------------------------
import pyvista

pyvista.OFF_SCREEN = True
# Preferred plotting style for documentation
pyvista.set_plot_theme("document")
pyvista.global_theme.window_size = np.array([512, 512]) * 2
pyvista.global_theme.window_size = [512, 512]
pyvista.global_theme.font.size = 18
pyvista.global_theme.font.label_size = 18
pyvista.global_theme.font.title_size = 18
pyvista.global_theme.return_cpos = False
# Necessary when building the sphinx gallery
pyvista.BUILDING_GALLERY = True
pyvista.set_jupyter_backend(None)


# -- Sphinx Gallery ------------------------------------------------------------
# JSOC email os env
# see https://github.com/sunpy/sunpy/wiki/Home:-JSOC
os.environ["JSOC_EMAIL"] = "jsoc@sunpy.org"
sphinx_gallery_conf = {
"backreferences_dir": os.path.join("generated", "modules"),
"filename_pattern": "^((?!skip_).)*$",
Expand All @@ -108,4 +113,5 @@
"remove_config_comments": True,
"doc_module": ("sunpy"),
"only_warn_on_example_error": True,
"image_scrapers": ("matplotlib", "pyvista"),
}
2 changes: 2 additions & 0 deletions examples/3d_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
###############################################################################
# We will use an AIA 193 image from the sunpy sample data as the base image.

# sphinx_gallery_defer_figures

# Start by creating a plotter
plotter = SunpyPlotter()
# Plot a map
Expand Down
7 changes: 1 addition & 6 deletions examples/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
Example Gallery
***************

The gallery contains examples of how to use sunpy.
The gallery contains examples of how to use ``sunkit-pyvista``.
Each example is a short and self contained how-to guide for performing a specific task.

Sample data
===========
Some of these examples require the SunPy sample data, which are downloaded as needed via the module `sunpy.data.sample`.
If you want to download all of the sample data files in advance, call :func:`sunpy.data.sample.download_all`.
28 changes: 12 additions & 16 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ long_description_content_type = text/x-rst
author = The SunPy Community
author_email = sunpy@googlegroups.com
license = BSD 3-Clause
license_file = licenses/LICENSE.rst
license_files = licenses/LICENSE.rst
url = https://github.com/sunpy/sunkit-pyvista
edit_on_github = True
github_project = sunpy/sunkit-pyvista
Expand Down Expand Up @@ -40,19 +40,18 @@ install_requires =

[options.extras_require]
tests =
pytest
pytest-cov
pytest-doctestplus
scikit-image
pytest
pytest-cov
pytest-doctestplus
scikit-image
docs =
jupyter-sphinx
pythreejs
sphinx
sphinx-automodapi
sphinx-changelog
streamtracer
sphinx-gallery
sunpy-sphinx-theme
sphinx
sphinx-automodapi
sphinx-changelog
streamtracer
sphinx-gallery
sunpy-sphinx-theme
ipython

[options.package_data]
sunkit_pyvista = data/*
Expand Down Expand Up @@ -96,15 +95,12 @@ max-line-length = 110
exclude =
.git,
__pycache__,
docs/conf.py,
build,
sunkit_pyvista/__init__.py,
rst-directives =
plot

[isort]
balanced_wrapping = True
skip=docs/conf.py,sunkit_pyvista/__init__.py
default_section = THIRDPARTY
include_trailing_comma = True
known_sunpy = astropy, sunpy
Expand Down

0 comments on commit ee38869

Please sign in to comment.