-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.py
More file actions
140 lines (116 loc) · 3.74 KB
/
Copy pathconf.py
File metadata and controls
140 lines (116 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
from unittest.mock import MagicMock
# Mock optional dependencies for headless doctest environments.
# We catch all exceptions because some libraries (like pyvista/vtk) may be
# installed but fail to initialize in headless CI runners.
try:
import pyvista # noqa: F401
pyvista.OFF_SCREEN = True
except Exception:
mock_pyvista = MagicMock()
mock_pyvista.OFF_SCREEN = True
sys.modules["pyvista"] = mock_pyvista
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as _pkg_version
# The project name used for branding and titles.
project = "PyEQSP: Python Equal Area Sphere Partitioning Library"
# The package name used for version lookup.
distribution_name = "pyeqsp"
copyright = "2026, Paul Leopardi"
author = "Paul Leopardi"
try:
release = _pkg_version(distribution_name)
except PackageNotFoundError:
release = "unknown"
# The short X.Y version.
version = ".".join(release.split(".")[:2]) if release != "unknown" else "unknown"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.mathjax",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"myst_parser",
"sphinx_rtd_theme",
"sphinxcontrib.mermaid",
"versionwarning.extension",
]
# When nitpicky mode is enabled it helps ensure that all internal
# and external links are valid. It is currently disabled.
# Set nitpicky = True to enable strict reference checking.
nitpicky = False
# Intersphinx mapping for external documentation links.
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy", None),
"matplotlib": ("https://matplotlib.org/stable", None),
}
# Disable Intersphinx in offline environments to prevent network warnings
if os.environ.get("PYEQSP_OFFLINE") == "1":
intersphinx_mapping = {}
# Nitpick ignore patterns for common scientific docstring labels
# that aren't real classes.
nitpick_ignore = [
("py:class", "M"),
("py:class", "N"),
("py:class", "array_like"),
("py:class", "array-like"),
("py:class", "ndarray"),
("py:class", "np.ndarray"),
("py:class", "optional"),
("py:class", "shape"),
("py:class", "{'stereo'"),
("py:class", "'eqarea'}"),
("py:class", "{'long'"),
("py:class", "'short'"),
("py:class", "'none'}"),
("py:class", "callable"),
("py:class", "numpy.ndarray with the same shape as N"),
("py:class", "color spec"),
("py:class", "Axes"),
]
doctest_global_setup = """
import numpy as np
from math import pi
from eqsp.utilities import *
from eqsp.partitions import *
from eqsp.point_set_props import *
from eqsp.region_props import *
from eqsp.histograms import *
"""
myst_enable_extensions = [
"dollarmath",
"amsmath",
"substitution",
"colon_fence",
]
myst_heading_anchors = 3
autodoc_mock_imports = ["pyvista"]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# --- Beta Engagement Configurations ---
# Version warning configuration
version_warning_messages = {
"latest": (
f"You are viewing the {release} documentation. Please report your findings "
'in our <a href="https://github.com/penguian/pyeqsp/issues/26">'
"Feedback Hub</a>."
),
}
# Sidebar Call to Action (via html_context for layout.html)
html_context = {
"display_beta_cta": True,
"beta_cta_text": "Report Beta Feedback",
"beta_cta_link": "https://github.com/penguian/pyeqsp/issues/26",
}
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}