-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.py
More file actions
124 lines (103 loc) · 4.82 KB
/
conf.py
File metadata and controls
124 lines (103 loc) · 4.82 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
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import subprocess
# Add python modules to be documented
python_root = '..'
python_modules = ( 'geos-ats', 'geos-geomechanics', 'geos-mesh', 'geos-processing', 'geos-pv', 'geos-timehistory',
'geos-utils', 'geos-xml-tools', 'hdf5-wrapper', 'mesh-doctor', 'pygeos-tools' )
for m in python_modules:
sys.path.insert( 0, os.path.abspath( os.path.join( python_root, m, 'src' ) ) )
# Install mesh-doctor in editable mode if not already available
# This ensures mesh-doctor command is available for sphinxcontrib.programoutput
try:
subprocess.run( [ sys.executable, '-m', 'geos.mesh_doctor.cli', '--help' ],
capture_output=True, check=True, timeout=5 )
except ( subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError ):
# mesh-doctor not available, install it and its dependencies in editable mode
print( "Installing mesh-doctor dependencies for documentation generation..." )
packages_to_install = [ 'geos-utils', 'geos-mesh', 'mesh-doctor' ]
for pkg in packages_to_install:
pkg_path = os.path.abspath( os.path.join( python_root, pkg ) )
try:
print( f" Installing {pkg}..." )
subprocess.run( [ sys.executable, '-m', 'pip', 'install', '-e', pkg_path ],
check=True, capture_output=True )
except subprocess.CalledProcessError as e:
print( f"Warning: Could not install {pkg}: {e}" )
print( "Documentation may be incomplete." )
break
else:
print( "mesh-doctor installed successfully." )
# -- Project information -----------------------------------------------------
project = u'GEOS Python Packages'
copyright = u'2018-2025 Lawrence Livermore National Security, The Board of Trustees of the Leland Stanford Junior University, TotalEnergies, and GEOS Contributors.'
author = u'GEOS Contributors'
# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u''
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.napoleon', 'sphinx_design', 'sphinx_rtd_theme', 'sphinxarg.ext', 'sphinxcontrib.programoutput',
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.mathjax', 'sphinx.ext.todo', 'sphinx.ext.viewcode'
]
autoclass_content = 'both'
autodoc_mock_imports = [ "ats", "colorcet", "meshio", "mpi4py", "numba", "paraview", "pygeosx",
"pyevtk", "pylvarray", "scipy", "segyio", "xmltodict", "xsdata" ]
autodoc_typehints = 'none'
autodoc_typehints_format = 'short'
suppress_warnings = [ "autodoc", "autodoc.mocked_object" ]
typehints_defaults = 'braces'
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = [ u'_build', 'Thumbs.db', '.DS_Store', 'cmake/*', '' ]
todo_include_todos = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
html_css_files = [ 'theme_overrides.css' ]
html_theme = "sphinx_rtd_theme"
html_theme_options = { 'navigation_depth': -1, 'collapse_navigation': False }
html_sidebars = {
"**": [
"about.html",
"navigation.html",
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
]
}
html_static_path = [ './_static' ]
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'geosPythonPackagesDoc'