Skip to content

Share streamflow statistics table and add climate model tables to hydrology docs - #736

Merged
cstephen merged 5 commits into
mainfrom
shared-streamflow-stats-docs
Jul 22, 2026
Merged

Share streamflow statistics table and add climate model tables to hydrology docs#736
cstephen merged 5 commits into
mainfrom
shared-streamflow-stats-docs

Conversation

@brucecrevensten

@brucecrevensten brucecrevensten commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Documentation-only changes to the /conus_hydrology and /arctic_hydrology docs pages:

  • Shared streamflow statistics table. The two separately maintained "Available Streamflow Statistics" tables are replaced by a single Jinja fragment (templates/documentation/streamflow_stats_table.html) included by both pages. The table incorporates the full statistic definitions from the hydroviz preprocessing stat_vars_dict: complete descriptions plus new Category and Difference method columns (the latter tells users whether ?source=gcm_diff values are ratios or absolute differences, previously only findable in the source data release).
  • Statistics tables moved to the top of both pages, directly after the introduction, ahead of the endpoint/output documentation.
  • New climate model tables, one per page, included above the streamflow statistics table:
    • CONUS (conus_models_table.html): the 13 CMIP5 GCMs with modeling center and available RCP scenarios, from the hydroviz gcm_metadata_dict. ACCESS1-0 and BNU-ESM only have RCP 4.5/8.5.
    • Arctic (arctic_models_table.html): the six downscaled runs (CESM2-LE members 2/4/7/9 under SSP3-7.0; PGWh/PGWm derived from SSP2-4.5), from the ak_hydro_segments rasdaman coverage model-axis metadata.

Notes

  • ma99 is kept in the stats table (served by the API but absent from stat_vars_dict), using its description from the CSV metadata in csv_functions.py.
  • The historical baselines (Maurer for CONUS, the ERA5-forced Blaskey hindcast for Arctic) are described in prose rather than listed as climate models.
  • Fixed a few source-text glitches in passing: a duplicated sentence in the dh4 description, spr_mag referring to MH20, and two typos ("Adminstration", "Gephysical").
  • Both templates are prettier-formatted.

Manual testing

  1. Run the API locally:
    micromamba activate api-env
    export FLASK_APP=application.py
    export FLASK_DEBUG=True
    flask run
    
  2. Visit http://localhost:5000/conus_hydrology and check:
    • A "Climate models" table (13 rows) appears right after the intro, followed by the "Available Streamflow Statistics" table (53 rows, with Category and Difference method columns).
    • The rest of the endpoint and output documentation renders normally below the tables.
  3. Visit http://localhost:5000/arctic_hydrology and check:
    • A "Climate models" table (6 rows) appears after the intro, followed by the same streamflow statistics table and then the "Available Water Temperature Statistics" table.
    • The streamflow statistics table content is identical to the CONUS page (it is the same fragment).
  4. Spot-check a couple of statistic definitions (e.g. dh2, ma99, spr_mag) against the JSON metadata returned by /conus_hydrology/stats/50563 and /arctic_hydrology/stats/81000004.

🤖 Generated with Claude Code

brucecrevensten and others added 4 commits July 22, 2026 12:46
Replace the two separately maintained "Available Streamflow Statistics"
tables in the CONUS and Arctic hydrology documentation with a single
shared Jinja fragment (streamflow_stats_table.html) included by both
pages.

The shared table incorporates the full statistic definitions from the
hydroviz preprocessing stat_vars_dict: complete descriptions, category
(duration/frequency/magnitude/rate of change/timing), difference method
(ratio vs. absolute, relevant to interpreting ?source=gcm_diff output),
and units. The ma99 row, which is served by the API but absent from
stat_vars_dict, is retained using its description from the CSV metadata.

Two source-text glitches were fixed in passing: a duplicated sentence in
the dh4 description and a copy/paste error in spr_mag that referred to
MH20.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Relocate the shared streamflow statistics table (and the Arctic water
temperature statistics table) from the bottom of the page to directly
after the introduction, ahead of the endpoint and output documentation.
Also reformats both templates with prettier.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a fragment listing the 13 CMIP5 GCMs used for the CONUS hydrology
dataset, included directly above the shared streamflow statistics table.
Model names, modeling centers, and available RCP scenarios come from the
gcm_metadata_dict in the hydroviz preprocessing pipeline (the Maurer
historical baseline is described in the page intro and is not listed as
a climate model). Two typos in the source dict were fixed in passing
(Administration, Geophysical).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a fragment listing the six downscaled model runs used for the
Arctic hydrology dataset (four CESM2 Large Ensemble members under
SSP3-7.0 and two pseudo-global warming runs derived from SSP2-4.5),
included directly above the shared streamflow statistics table,
mirroring the CONUS docs page structure. Run names and descriptions
come from the model axis metadata of the ak_hydro_segments rasdaman
coverages. The ERA5-forced Blaskey hindcast (the "historical" model
key) is described in the fragment intro rather than listed as a
climate model.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cstephen
cstephen self-requested a review July 22, 2026 20:56

@cstephen cstephen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit to replace - with a comma in the stat table unit descriptions. Since these descriptions often describe the math involved in calculating each statistic, the - used as a separator can easily be mistaken for a subtraction operation. These were lifted from the CSV metadata descriptions where we need to be careful about using commas, but there's no such problem for the HTML documentation.

For example, this:

(number of days/year - temporal)

Was changed to this:

(number of days/year, temporal)

I also spot checked the new information about models, scenarios, etc. that were added to the documentation vs. the source of this new information (as described in the PR description) to make sure it was correct. I found no errors. This new information looks good and is valuable for the people who want to know it, without cluttering the hydroviz webapp itself.

@cstephen
cstephen merged commit 6fef527 into main Jul 22, 2026
1 check failed
@cstephen
cstephen deleted the shared-streamflow-stats-docs branch July 22, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants