Skip to content

Commit d35adff

Browse files
authored
Merge pull request #128 from uw-cryo/docs
Fix RTD Build
2 parents ad4d194 + 8283200 commit d35adff

27 files changed

+1120
-837
lines changed

.readthedocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ build:
1212
# https://github.com/readthedocs/readthedocs.org/issues/6311...
1313
install:
1414
# Install specific pixi environment and list packages
15+
- free -h
1516
- curl -fsSL https://pixi.sh/install.sh | bash
1617
- $HOME/.pixi/bin/pixi list -e docs
1718
build:

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ IO
5656
xarray.load_neon_dem
5757
xarray.load_noaa_dem
5858
xarray.load_ncalm_dem
59+
xarray.load_gliht
5960
download.download_item
6061
download.read_href
6162
download.build_usgs_ept_pipeline

docs/conf.py

Lines changed: 98 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,123 @@
11
from __future__ import annotations
22

33
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)
410

511
project = "coincident"
6-
copyright = "2025, UW TACO Lab"
12+
copyright = "2026, UW TACO Lab"
713
author = "Scott Henderson"
814
version = release = importlib.metadata.version("coincident")
915

1016
# NOTE: it seems order of extensions matters if one depends on another
1117
extensions = [
12-
# "myst_parser",
18+
# "myst_parser", # myst-nb includes myst-parser
1319
"myst_nb",
1420
"sphinx.ext.autodoc",
1521
"sphinx.ext.autosummary",
1622
"sphinx.ext.intersphinx",
17-
"sphinx.ext.mathjax",
23+
# "sphinx.ext.mathjax",
1824
"sphinx.ext.napoleon",
1925
"sphinx.ext.viewcode",
2026
"sphinx_autodoc_typehints",
2127
"sphinx_copybutton",
2228
"sphinx_design",
2329
]
2430

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+
25112
source_suffix = {
26113
".rst": "restructuredtext",
27114
".ipynb": "myst-nb",
28115
".md": "myst-nb",
29116
}
30117
exclude_patterns = [
31118
"_build",
119+
# "datasets", # UNCOMMENT to temporarily disable executing notebooks
120+
# "examples",
32121
"**.ipynb_checkpoints",
33122
"Thumbs.db",
34123
".DS_Store",
@@ -85,22 +174,25 @@
85174

86175
intersphinx_mapping = {
87176
"python": ("https://docs.python.org/3", None),
177+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
88178
"geopandas": ("https://geopandas.org/en/latest", None),
89179
"pystac_client": ("https://pystac-client.readthedocs.io/en/stable", None),
90180
"pystac": ("https://pystac.readthedocs.io/en/stable", None),
91181
"stac-asset": ("https://stac-asset.readthedocs.io/en/latest", None),
92182
"xarray": ("https://docs.xarray.dev/en/stable", None),
183+
"arro3": ("https://kylebarron.dev/arro3/latest", None),
93184
}
94185

95186
nitpick_ignore = [
96187
("py:class", "_io.StringIO"),
97188
("py:class", "_io.BytesIO"),
98189
]
99190

100-
always_document_param_types = True
191+
# always_document_param_types = True
101192
# autodoc_typehints = "none"
102193
nb_execution_mode = "auto" # off, on
103194
nb_execution_show_tb = True
104195
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"]

docs/datasets/NCALM.ipynb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"outputs": [],
8888
"source": [
8989
"buffer_size = 0.01\n",
90-
"centroid = gf_ncalm.centroid\n",
90+
"centroid = gf_ncalm.centroid[0]\n",
9191
"mini_aoi = gpd.GeoDataFrame(\n",
9292
" geometry=[\n",
9393
" box(\n",
@@ -111,7 +111,6 @@
111111
"metadata": {},
112112
"outputs": [],
113113
"source": [
114-
"%%time\n",
115114
"da_ncalm_dtm = coincident.io.xarray.load_ncalm_dem(\n",
116115
" aoi=mini_aoi, product=\"dtm\", dataset_id=gf_ncalm[\"name\"].item()\n",
117116
")"
@@ -158,16 +157,16 @@
158157
"metadata": {},
159158
"outputs": [],
160159
"source": [
161-
"%%time\n",
160+
"# Uncomment to download clipped_WALL_GEG_1M_dtm.tif\n",
162161
"\n",
163-
"local_output_dir = \"/tmp/ncalm/\"\n",
162+
"# local_output_dir = \"/tmp/ncalm/\"\n",
164163
"\n",
165-
"coincident.io.download.download_ncalm_dem(\n",
166-
" aoi=mini_aoi,\n",
167-
" dataset_id=gf_ncalm[\"name\"].item(),\n",
168-
" product=\"dtm\",\n",
169-
" output_dir=local_output_dir,\n",
170-
")"
164+
"# coincident.io.download.download_ncalm_dem(\n",
165+
"# aoi=mini_aoi,\n",
166+
"# dataset_id=gf_ncalm[\"name\"].item(),\n",
167+
"# product=\"dtm\",\n",
168+
"# output_dir=local_output_dir,\n",
169+
"# )"
171170
]
172171
},
173172
{
@@ -185,7 +184,6 @@
185184
"metadata": {},
186185
"outputs": [],
187186
"source": [
188-
"%%time\n",
189187
"gf_ncalm_lpc_tiles = coincident.io.download.fetch_lpc_tiles(\n",
190188
" aoi=mini_aoi, dataset_id=gf_ncalm.name.item(), provider=\"NCALM\"\n",
191189
")"

docs/datasets/noaa-coastal-lidar.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"source": [
6565
"# Plot the entire footprint for this scene and a subset region\n",
6666
"buffer_size = 0.02\n",
67-
"centroid = gf_noaa.centroid\n",
67+
"centroid = gf_noaa.geometry.centroid[0]\n",
6868
"mini_aoi = gpd.GeoDataFrame(\n",
6969
" geometry=[\n",
7070
" box(\n",

0 commit comments

Comments
 (0)