Skip to content

Commit

Permalink
WIP: Remove dependencies from doc-noexamples
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Feb 28, 2024
1 parent 390317b commit a8f8b15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 39 deletions.
50 changes: 17 additions & 33 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import sys
import warnings

import pyvista
import numpy as np
import json
from sphinx_gallery.sorting import FileNameSortKey
from ansys_sphinx_theme import (ansys_favicon,
get_version_match, pyansys_logo_black,
Expand Down Expand Up @@ -230,26 +228,27 @@ def setup(app):
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"

# Manage errors
pyvista.set_error_output_file("errors.txt")

# Ensure that offscreen rendering is used for docs generation
pyvista.OFF_SCREEN = True

# Preferred plotting style for documentation
# pyvista.set_plot_theme('document')

# must be less than or equal to the XVFB window size
pyvista.global_theme["window_size"] = np.array([1024, 768])

# Save figures in specified directory
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)

# gallery build requires AEDT install
# if is_windows and bool(os.getenv("PYAEDT_CI_RUN_EXAMPLES", "0")):
if run_examples:
import pyvista

# # Pyvista settings

# Ensure that offscreen rendering is used for docs generation
pyvista.OFF_SCREEN = True
# Save figures in specified directory
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)
# Necessary for pyvista when building the sphinx gallery
pyvista.BUILDING_GALLERY = True

# Manage errors
pyvista.set_error_output_file("errors.txt")
# Must be less than or equal to the XVFB window size
pyvista.global_theme["window_size"] = np.array([1024, 768])

# suppress annoying matplotlib bug
warnings.filterwarnings(
Expand All @@ -258,9 +257,6 @@ def setup(app):
message="Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.",
)

# necessary for pyvista when building the sphinx gallery
pyvista.BUILDING_GALLERY = True

extensions.append("sphinx_gallery.gen_gallery")
sphinx_gallery_conf = {
# convert rst to md for ipynb
Expand Down Expand Up @@ -289,18 +285,6 @@ def setup(app):
"run_examples": run_examples,
},
}
# def prepare_jinja_env(jinja_env) -> None:
# """
# Customize the jinja env.
#
# Notes
# -----
# See https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment
# """
# jinja_env.globals["project_name"] = project
#
#
# autoapi_prepare_jinja_env = prepare_jinja_env

# -- Options for HTML output -------------------------------------------------
html_short_title = html_title = "PyAEDT"
Expand Down
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,8 @@ doc-noexamples = [
"ansys-sphinx-theme==0.13.1",
"imageio==2.31.5",
"imageio-ffmpeg==0.4.9",
"matplotlib==3.5.3; python_version == '3.7'",
"matplotlib==3.7.3; python_version == '3.8'",
"matplotlib==3.8.0; python_version > '3.8'",
"numpydoc==1.5.0; python_version == '3.7'",
"numpydoc==1.6.0; python_version > '3.7'",
"vtk==9.2.6",
"pyvista==0.42.2; python_version > '3.7'",
"pyvista==0.38.0; python_version <= '3.7'",
"recommonmark==0.7.1",
"Sphinx==7.1.2; python_version <= '3.9'",
"Sphinx==7.2.6; python_version >= '3.9'",
Expand Down

0 comments on commit a8f8b15

Please sign in to comment.