Skip to content

Commit

Permalink
Undo it all
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Mar 16, 2023
1 parent 859c096 commit a314dfb
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 32 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yaml
Expand Up @@ -7,6 +7,7 @@ build:
apt_packages:
- xvfb
- libgl1-mesa-dev
- mesa-utils

conda:
environment: .rtd-environment.yml
Expand Down
33 changes: 5 additions & 28 deletions docs/conf.py
Expand Up @@ -6,13 +6,14 @@
from datetime import datetime

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

from sunkit_pyvista import __version__

# -- Project information -----------------------------------------------------
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
os.environ["HIDE_PARFIVE_PROGESS"] = "True"
os.environ["PYDEVD_DISABLE_FILE_VALIDATION"] = "1"
project = "sunkit-pyvista"
author = "SunPy Community"
copyright = "{}, {}".format(datetime.now().year, author)
Expand All @@ -28,7 +29,6 @@
extensions = [
"sphinx_automodapi.automodapi",
"sphinx_automodapi.smart_resolver",
"sphinx_gallery.gen_gallery",
"sphinx_changelog",
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
Expand All @@ -39,6 +39,7 @@
"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,31 +88,7 @@
import pyvista

pyvista.OFF_SCREEN = True
# Preferred plotting style for documentation
pyvista.set_plot_theme("document")
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 ------------------------------------------------------------
sphinx_gallery_conf = {
"backreferences_dir": os.path.join("generated", "modules"),
"filename_pattern": "^((?!skip_).)*$",
"examples_dirs": os.path.join("..", "examples"),
"gallery_dirs": os.path.join("generated", "gallery"),
"matplotlib_animations": True,
# Comes from the theme.
"default_thumb_file": png_icon, # NOQA
"abort_on_example_error": False,
"plot_gallery": "True",
"remove_config_comments": True,
"doc_module": ("sunpy"),
"only_warn_on_example_error": True,
"image_scrapers": ("matplotlib", "pyvista"),
}
if on_rtd:
pyvista.start_xvfb()
8 changes: 8 additions & 0 deletions docs/examples/3d_functionality.rst
@@ -0,0 +1,8 @@
==================================
Extending functionality from sunpy
==================================

.. jupyter-execute:: setup.py
:hide-code:

.. jupyter-execute:: ../../examples/3d_functionality.py
13 changes: 13 additions & 0 deletions docs/examples/_readme.txt
@@ -0,0 +1,13 @@
To create a new example, follow these steps:

1. Create a new python script for the example in /examples/. You should be
able to run this script by itself, and produce a plot at the end.
2. Create a .rst file in this directory that has:
- A title
- .. jupyter-execute:: setup.py
:hide-code:

- .. jupyter-execute:: ../../examples/FILENAME.py


where FILENAME is the name of the file created in step 1.
8 changes: 8 additions & 0 deletions docs/examples/assume_spherical.rst
@@ -0,0 +1,8 @@
========================
Ignoring off-limb pixels
========================

.. jupyter-execute:: setup.py
:hide-code:

.. jupyter-execute:: ../../examples/assume_spherical.py
8 changes: 8 additions & 0 deletions docs/examples/field_lines.rst
@@ -0,0 +1,8 @@
================================
Plotting Field Lines from pfsspy
================================

.. jupyter-execute:: setup.py
:hide-code:

.. jupyter-execute:: ../../examples/field_lines.py
10 changes: 10 additions & 0 deletions docs/examples/index.rst
@@ -0,0 +1,10 @@
***************
Example Gallery
***************

This gallery contains examples of how to use sunkit-pyvista.

.. toctree::
:glob:

*
3 changes: 3 additions & 0 deletions docs/examples/setup.py
@@ -0,0 +1,3 @@
import pyvista

pyvista.global_theme.jupyter_backend = "trame"
2 changes: 1 addition & 1 deletion docs/index.rst
Expand Up @@ -10,6 +10,6 @@ It is built on top of the `pyvista` package, which itself is built as a Python i

installing
getting_started
generated/gallery/index
examples/index
api
changelog
2 changes: 2 additions & 0 deletions examples/README.txt
Expand Up @@ -4,3 +4,5 @@ Example Gallery

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.

These files are executed by the documentation build process and the output is embedded.
7 changes: 4 additions & 3 deletions setup.cfg
Expand Up @@ -35,7 +35,7 @@ setup_requires =
setuptools_scm
install_requires =
pfsspy>=1.1.2
pyvista>= 0.38.4
pyvista[all]>= 0.38.4
sunpy[map]>=4.0.0

[options.extras_require]
Expand All @@ -45,13 +45,14 @@ tests =
pytest-doctestplus
scikit-image
docs =
jupyter-sphinx
sphinx
sphinx-automodapi
sphinx-changelog
streamtracer
sphinx-gallery
streamtracer
sunpy-sphinx-theme
ipython
trame

[options.package_data]
sunkit_pyvista = data/*
Expand Down

0 comments on commit a314dfb

Please sign in to comment.