Skip to content

Commit 941ec23

Browse files
EliEli
authored andcommitted
Change to sphinx-click and clean up heading underlining to correct length.
1 parent 8ae856d commit 941ec23

9 files changed

Lines changed: 82 additions & 62 deletions

File tree

docsrc/commands.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use the `dms` grouped CLI (or call commands directly by script name).
1818
dms download_ncro --help
1919
2020
Command Help Shortcuts
21-
-----------------------
21+
----------------------
2222

2323
.. code-block:: bash
2424
@@ -54,7 +54,7 @@ Command Help Shortcuts
5454
rationalize_time_partitions --help
5555
5656
Workflow A: Repository Build Pipeline (Download → Reformat → Auto Screen)
57-
-----------------------------------------------------------------------
57+
-------------------------------------------------------------------------
5858

5959
Stage 1: Download into raw/staging
6060

@@ -124,7 +124,7 @@ Workflow B: Dropbox Ingest (separate workflow)
124124
dropbox --input dms_datastore/config_data/dropbox_spec.yaml
125125
126126
Workflow C: Staging → Repo update and utilities
127-
------------------------------------------------
127+
-----------------------------------------------
128128

129129
.. code-block:: bash
130130
@@ -134,4 +134,4 @@ Workflow C: Staging → Repo update and utilities
134134
Additional Utilities
135135
--------------------
136136

137-
See the documentation for details and examples for `station_info`, `merge_files`, `coarsen`, and other utilities.
137+
See the documentation for details and examples for `station_info`, `merge_files`, `coarsen`, and other utilities.

docsrc/concepts.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Units and Standardization
155155

156156

157157
Known Challenges and Exceptions
158-
================================
158+
===============================
159159

160160
**WDL Station IDs**
161161
WDL station IDs may not match the canonical ``station_id`` due to appended ``"00"``
@@ -170,4 +170,3 @@ Known Challenges and Exceptions
170170
USGS may have multiple instruments measuring the same variable for one station ID
171171
due to different programs or sublocations. The ``raw/`` directory can store dual
172172
versions for QA/QC, though the processed set should ideally be unified.
173-

docsrc/conf.py

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,35 @@
1616

1717

1818
# -- Project information -----------------------------------------------------
19-
import dms_datastore
19+
import sys
2020
import os
21+
from unittest.mock import MagicMock
22+
23+
# Mock heavy/unavailable dependencies before importing dms_datastore,
24+
# so conf.py works in the CI docs environment without the full conda env.
25+
_MOCK_MODULES = [
26+
"vtools", "vtools.data", "vtools.data.indexing", "vtools.data.vtime",
27+
"vtools.data.timeseries", "vtools.data.gap", "vtools.data.duplicate_index",
28+
"vtools.functions", "vtools.functions.merge", "vtools.functions.filter",
29+
"vtools.functions.coarsen", "vtools.functions.error_detect",
30+
"vtools.functions.unit_conversions",
31+
"schimpy", "schimpy.station", "schimpy.unit_conversions",
32+
"tabula",
33+
"geopandas",
34+
"shapely", "shapely.geometry",
35+
"diskcache",
36+
"seaborn",
37+
"dask", "dask.dataframe",
38+
"paramiko",
39+
"boto3",
40+
"cfgrib",
41+
"eccodes",
42+
"numba",
43+
]
44+
for _mod in _MOCK_MODULES:
45+
sys.modules.setdefault(_mod, MagicMock())
46+
47+
import dms_datastore
2148

2249
project = 'dms_datastore'
2350
copyright = '2022, Eli Ateljevich, CA DWR'
@@ -43,19 +70,23 @@
4370

4471
# Add any Sphinx extension module names here, as strings. They can be
4572
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
46-
extensions = [ 'sphinx_rtd_theme', 'nbsphinx',
47-
'sphinxcontrib.mermaid',
48-
'sphinx.ext.mathjax',
49-
'sphinx.ext.autodoc',
50-
'sphinx.ext.viewcode',
51-
'matplotlib.sphinxext.mathmpl',
52-
'matplotlib.sphinxext.plot_directive',
53-
'sphinx.ext.intersphinx',
54-
'sphinx.ext.autodoc',
55-
#'sphinx_argparse_cli',
56-
'sphinxarg.ext',
57-
'sphinx.ext.doctest',
58-
'numpydoc']
73+
extensions = [
74+
'sphinx_rtd_theme',
75+
'nbsphinx',
76+
'sphinxcontrib.mermaid',
77+
'sphinx.ext.mathjax',
78+
'sphinx.ext.autodoc',
79+
'sphinx.ext.viewcode',
80+
'matplotlib.sphinxext.mathmpl',
81+
'matplotlib.sphinxext.plot_directive',
82+
'sphinx.ext.intersphinx',
83+
'sphinx.ext.autodoc',
84+
#'sphinx_argparse_cli',
85+
'sphinxarg.ext',
86+
'sphinx_click',
87+
'sphinx.ext.doctest',
88+
'numpydoc',
89+
]
5990

6091
autodoc_member_order = 'alphabetical'
6192

docsrc/download_data.rst

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,25 @@ Station Lists
1414

1515

1616
Specific Command Line Interfaces
17-
=================================
17+
================================
1818

1919
CDEC
20-
^^^^^^
21-
.. argparse::
22-
:module: dms_datastore.download_cdec
23-
:func: create_arg_parser
20+
^^^^
21+
.. click:: dms_datastore.download_cdec:download_cdec_cli
2422
:prog: download_cdec
2523

2624

2725

2826
USGS (NWIS)
29-
^^^^^^^^^^^^^
27+
^^^^^^^^^^^
3028

31-
.. argparse::
32-
:module: dms_datastore.download_nwis
33-
:func: create_arg_parser
29+
.. click:: dms_datastore.download_nwis:download_nwis_cli
3430
:prog: download_nwis
3531

3632
NOAA
3733
^^^^
3834

39-
.. argparse::
40-
:module: dms_datastore.download_noaa
41-
:func: create_arg_parser
35+
.. click:: dms_datastore.download_noaa:download_noaa_cli
4236
:prog: download_noaa
4337

4438
DWR-NCRO
@@ -55,17 +49,12 @@ so its interface is simpler, less flexible and different from the others.
5549
# :module: dms_datastore.download_ncro
5650
# :func: create_arg_parser
5751
# :prog: download_ncro.py
58-
52+
53+
.. click:: dms_datastore.download_des:download_des_cli
54+
:prog: download_des
5955
DWR-DES (DISE)
6056
^^^^^^^^^^^^^^
6157

6258
DWR Division of Environmental Services has been renamed but the name has not yet been updated here.
6359
These web services are internal to DWR. External users can get reformatted/screened data from our group or request data
6460
from DWR liasons who are identified on CDEC on a per-station basis.
65-
66-
.. argparse::
67-
:module: dms_datastore.download_des
68-
:func: create_arg_parser
69-
:prog: download_des
70-
71-

docsrc/dropbox.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Key Components
2222
metadata inference rules.
2323

2424
How it works
25-
-----------
25+
------------
2626

2727
The processing follows these steps:
2828

docsrc/read_data_meta.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Additional methods from ``vtools3``
8787

8888

8989
Reading Data with ``read_ts_repo``
90-
===================================
90+
==================================
9191

9292
:func:`~dms_datastore.read_multi.read_ts_repo` is the primary way to access data
9393
from the datastore. It handles file path construction, source prioritization,
@@ -150,7 +150,7 @@ Function parameters
150150

151151

152152
Example: retrieval and visualization
153-
-------------------------------------
153+
------------------------------------
154154

155155
.. code-block:: python
156156
@@ -176,7 +176,7 @@ Example: retrieval and visualization
176176
177177
178178
Caching repeated reads
179-
-----------------------
179+
----------------------
180180

181181
For repeated access to the same data the datastore provides the
182182
``@cache_dataframe`` decorator:
@@ -199,4 +199,4 @@ For repeated access to the same data the datastore provides the
199199
# Subsequent calls use cached data
200200
daily_flow = get_filtered_flow(station="sjj", variable="flow")
201201
202-
See also the :doc:`Local Caching notebook <notebooks/cache>` for a hands-on walkthrough.
202+
See also the :doc:`Local Caching notebook <notebooks/cache>` for a hands-on walkthrough.

docsrc/repository.rst

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

3-
###########################
3+
########################
44
Time Series Repositories
5-
###########################
5+
########################
66

77
This page describes the design of the repository system for developers and advanced
88
users who need to build inventory tools, implement downloaders, or integrate with
@@ -25,7 +25,7 @@ These form a strict, deterministic pipeline::
2525

2626

2727
Repository Configuration
28-
=========================
28+
========================
2929

3030
A repo configuration defines how a directory of files is interpreted as structured data.
3131

@@ -70,7 +70,7 @@ Key terminology
7070

7171

7272
Source Priority Configuration
73-
------------------------------
73+
-----------------------------
7474

7575
The ``source_priority`` block in ``dstore_config.yaml`` specifies preferred data
7676
sources per agency-managed station group:
@@ -93,7 +93,7 @@ For example, EBMUD station data is resolved by preferring USGS, then EBMUD, then
9393

9494

9595
Filename Templates and Interpretation
96-
======================================
96+
=====================================
9797

9898
Filename templates define the bidirectional mapping between metadata and filenames.
9999

@@ -120,7 +120,7 @@ Design rules:
120120

121121

122122
Registry (station_dbase.csv)
123-
=============================
123+
============================
124124

125125
The registry provides authoritative metadata that enriches filename-derived fields.
126126

@@ -138,7 +138,7 @@ Inventory System
138138
Inventory converts repository files into structured summaries.
139139

140140
File inventory (``repo_file_inventory``)
141-
-----------------------------------------
141+
----------------------------------------
142142

143143
Groups by ``file_pattern``. Represents:
144144

@@ -147,7 +147,7 @@ Groups by ``file_pattern``. Represents:
147147
* Provider-specific datasets
148148

149149
Data inventory (``repo_data_inventory``)
150-
-----------------------------------------
150+
----------------------------------------
151151

152152
Groups by ``series_id``. Represents:
153153

@@ -167,7 +167,7 @@ A ``series_id`` is constructed from metadata::
167167

168168

169169
Populating the Repository
170-
==========================
170+
=========================
171171

172172
The :doc:`commands` page documents the full CLI workflow. A summary::
173173

@@ -225,7 +225,7 @@ Guarantees: stable formatting, idempotent round-trip, canonical YAML header.
225225

226226

227227
End-to-End Flow
228-
================
228+
===============
229229

230230
Read path::
231231

@@ -241,7 +241,7 @@ Write path::
241241

242242

243243
Design Principles
244-
==================
244+
=================
245245

246246
Fail fast
247247
Bad filenames → error. Bad config → error. No implicit recovery.
@@ -265,7 +265,7 @@ Separation of concerns
265265

266266

267267
Architectural Evolution Notes
268-
==============================
268+
=============================
269269

270270
The repository system was refactored from an implicit agency-based model to a fully
271271
config-driven provider model. Key terminology changes:
@@ -284,5 +284,4 @@ Configs **must** define ``site_key``, ``provider_key``, and
284284
``provider_resolution_mode``. Misconfigured repos fail immediately — there is
285285
no fallback behavior.
286286

287-
The legacy ``parse.style = legacy`` option remains for backward compatibility.
288-
287+
The legacy ``parse.style = legacy`` option remains for backward compatibility.

docsrc/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ pandoc
1313
matplotlib # needed for matplotlib.sphinxext.mathmply
1414
ipython # neededd for IPython.sphinxext.ipython_directive
1515
pip
16+
sphinx-click
17+
click

docsrc/station_info.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See :doc:`commands` for the full CLI reference.
1414

1515

1616
Configuration System
17-
=====================
17+
====================
1818

1919
The datastore uses YAML files and Python modules to manage station metadata,
2020
variable mappings, and screening configurations.
@@ -76,7 +76,7 @@ All functions cache their results to avoid repeated filesystem reads.
7676

7777

7878
Screen Configuration
79-
---------------------
79+
--------------------
8080

8181
The screening configuration YAML (referenced by ``screen_config`` in
8282
``dstore_config.yaml``) drives :mod:`~dms_datastore.auto_screen` and contains
@@ -85,4 +85,4 @@ rule sets for:
8585
* **Bounds checking** — acceptable min/max values per variable
8686
* **Spike detection** — parameters for flagging data spikes
8787
* **Repetition checking** — rules for flagging suspicious repeated values
88-
* **Custom screening functions** — advanced algorithms for specific data types
88+
* **Custom screening functions** — advanced algorithms for specific data types

0 commit comments

Comments
 (0)