|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import importlib.metadata |
| 4 | +import warnings |
| 5 | + |
| 6 | +from sphinx.deprecation import RemovedInSphinx10Warning |
| 7 | + |
| 8 | +# Ignore specific RemovedInSphinx warnings |
| 9 | +warnings.filterwarnings("ignore", category=RemovedInSphinx10Warning) |
4 | 10 |
|
5 | 11 | project = "coincident" |
6 | | -copyright = "2025, UW TACO Lab" |
| 12 | +copyright = "2026, UW TACO Lab" |
7 | 13 | author = "Scott Henderson" |
8 | 14 | version = release = importlib.metadata.version("coincident") |
9 | 15 |
|
10 | 16 | # NOTE: it seems order of extensions matters if one depends on another |
11 | 17 | extensions = [ |
12 | | - # "myst_parser", |
| 18 | + # "myst_parser", # myst-nb includes myst-parser |
13 | 19 | "myst_nb", |
14 | 20 | "sphinx.ext.autodoc", |
15 | 21 | "sphinx.ext.autosummary", |
16 | 22 | "sphinx.ext.intersphinx", |
17 | | - "sphinx.ext.mathjax", |
| 23 | + # "sphinx.ext.mathjax", |
18 | 24 | "sphinx.ext.napoleon", |
19 | 25 | "sphinx.ext.viewcode", |
20 | 26 | "sphinx_autodoc_typehints", |
21 | 27 | "sphinx_copybutton", |
22 | 28 | "sphinx_design", |
23 | 29 | ] |
24 | 30 |
|
| 31 | + |
| 32 | +# Code block syntax highlighting |
| 33 | +pygments_style = "sphinx" |
| 34 | + |
| 35 | +# Show simplified type names |
| 36 | +typehints_fully_qualified = False |
| 37 | + |
| 38 | +autodoc_type_aliases = { |
| 39 | + "gpd.GeoDataFrame": "geopandas.GeoDataFrame", |
| 40 | + "gpd.GeoSeries": "geopandas.GeoSeries", |
| 41 | + "xr.DataArray": "xarray.DataArray", |
| 42 | + "xr.Dataset": "xarray.Dataset", |
| 43 | + "pd.Series": "pandas.Series", |
| 44 | + "pd.Timestamp": "pandas.Timestamp", |
| 45 | + "pd.DataFrame": "pandas.DataFrame", |
| 46 | + "pystac.item_collection.ItemCollection": "pystac.ItemCollection", |
| 47 | + "pystac_client.client.Client": "pystac_client.Client", |
| 48 | + "pystac_client.item_search.ItemSearch": "pystac_client.ItemSearch", |
| 49 | + "arro3.core.Table": "arro3.core.Table", # don't abbreviate this one |
| 50 | +} |
| 51 | + |
| 52 | +autosummary_generate = True |
| 53 | +autosummary_generate_overwrite = False # Don't regenerate existing files |
| 54 | + |
| 55 | +# Saves RAM by not importing and inspecting all dependencies! |
| 56 | +autodoc_mock_imports = [ |
| 57 | + # Heavy geospatial libraries with C/C++ extensions |
| 58 | + "rasterio", # GDAL wrapper, very memory-intensive |
| 59 | + "osgeo", # GDAL Python bindings |
| 60 | + "gdal", |
| 61 | + "gdal_array", |
| 62 | + "pyogrio", # Fast geospatial I/O |
| 63 | + # Heavy data processing libraries |
| 64 | + "odc.stac", # Open Data Cube STAC loader |
| 65 | + "xarray", # Large array operations |
| 66 | + "rioxarray", # Rasterio + xarray |
| 67 | + # Cloud/AWS libraries |
| 68 | + "boto3", |
| 69 | + "botocore", |
| 70 | + "aiobotocore", |
| 71 | + "s3fs", |
| 72 | + # Heavy geospatial analysis |
| 73 | + # "geopandas", # mocking breaks type hint hyperlinks |
| 74 | + # "shapely", # mocking breaks type hint hyperlinks |
| 75 | + "pyproj", |
| 76 | + # Specialized data access |
| 77 | + "sliderule", |
| 78 | + "maxar_platform", |
| 79 | + # STAC libraries (less critical but can add up) |
| 80 | + # NOTE: pystac and pystac_client are needed for intersphinx type linking |
| 81 | + # "pystac", |
| 82 | + # "pystac_client", |
| 83 | + "rustac", |
| 84 | + "stac_asset", |
| 85 | + # Arrow ecosystem |
| 86 | + # "arro3.core", # mocking breaks type hint hyperlinks |
| 87 | + # "pyarrow", # mocking breaks type hint hyperlinks |
| 88 | + # Visualization (probably safe to mock for docs) |
| 89 | + "matplotlib", |
| 90 | + "contextily", |
| 91 | + "matplotlib_scalebar", |
| 92 | + "xyzservices", |
| 93 | + # Misc heavy dependencies |
| 94 | + "scipy", |
| 95 | + "tqdm", |
| 96 | + "requests", |
| 97 | +] |
| 98 | + |
| 99 | + |
| 100 | +autodoc_preserve_defaults = True |
| 101 | +autodoc_typehints = "description" # Show type hints in docstring only, not in signature |
| 102 | +autodoc_default_options = { |
| 103 | + "members": True, |
| 104 | + "member-order": "bysource", |
| 105 | + "undoc-members": False, # Skip undocumented members |
| 106 | + "private-members": False, |
| 107 | + "special-members": False, |
| 108 | + "inherited-members": False, # Don't document inherited members |
| 109 | + "show-inheritance": False, |
| 110 | +} |
| 111 | + |
25 | 112 | source_suffix = { |
26 | 113 | ".rst": "restructuredtext", |
27 | 114 | ".ipynb": "myst-nb", |
28 | 115 | ".md": "myst-nb", |
29 | 116 | } |
30 | 117 | exclude_patterns = [ |
31 | 118 | "_build", |
| 119 | + # "datasets", # UNCOMMENT to temporarily disable executing notebooks |
| 120 | + # "examples", |
32 | 121 | "**.ipynb_checkpoints", |
33 | 122 | "Thumbs.db", |
34 | 123 | ".DS_Store", |
|
85 | 174 |
|
86 | 175 | intersphinx_mapping = { |
87 | 176 | "python": ("https://docs.python.org/3", None), |
| 177 | + "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None), |
88 | 178 | "geopandas": ("https://geopandas.org/en/latest", None), |
89 | 179 | "pystac_client": ("https://pystac-client.readthedocs.io/en/stable", None), |
90 | 180 | "pystac": ("https://pystac.readthedocs.io/en/stable", None), |
91 | 181 | "stac-asset": ("https://stac-asset.readthedocs.io/en/latest", None), |
92 | 182 | "xarray": ("https://docs.xarray.dev/en/stable", None), |
| 183 | + "arro3": ("https://kylebarron.dev/arro3/latest", None), |
93 | 184 | } |
94 | 185 |
|
95 | 186 | nitpick_ignore = [ |
96 | 187 | ("py:class", "_io.StringIO"), |
97 | 188 | ("py:class", "_io.BytesIO"), |
98 | 189 | ] |
99 | 190 |
|
100 | | -always_document_param_types = True |
| 191 | +# always_document_param_types = True |
101 | 192 | # autodoc_typehints = "none" |
102 | 193 | nb_execution_mode = "auto" # off, on |
103 | 194 | nb_execution_show_tb = True |
104 | 195 | nb_execution_timeout = 90 |
105 | | -nb_execution_allow_errors = False |
106 | | -# nb_execution_excludepatterns = ["elevation_plotting.ipynb"] |
| 196 | +nb_execution_allow_errors = True |
| 197 | +# NOTE: skip execution of specific notebooks that require large downloads or long processing times |
| 198 | +nb_execution_excludepatterns = ["noaa-coastal-lidar.ipynb"] |
0 commit comments