Skip to content

feat: Add model cards documentation infrastructure#1210

Draft
sunt05 wants to merge 6 commits intomasterfrom
sunt05/model-cards
Draft

feat: Add model cards documentation infrastructure#1210
sunt05 wants to merge 6 commits intomasterfrom
sunt05/model-cards

Conversation

@sunt05
Copy link

@sunt05 sunt05 commented Feb 19, 2026

Summary

Introduces a comprehensive model cards system for all 22 SUEWS physics schemes, with a tabbed index page organised by enum class and an interactive comparison widget.

Key Changes

  • Schema & validation: src/supy/model_cards/_schema.py — Pydantic-based YAML schema covering identity, scientific basis, evaluation, technical characteristics, operational status, and user guidance
  • 22 model cards: YAML files for every physics scheme (narp, ohm, stebbs, spartacus, ehc, beers, lumps, etc.)
  • RST generator: docs/generate_model_cards_rst.py — produces sphinx-design cards, tabs, badges, and embedded HTML/JS comparison widget
  • Tabbed index page: Schemes grouped by enum_class in a tab-set layout; multi-value cards expanded into per-option cards using enum docstrings (e.g. StabilityMethod shows 3 separate cards for each formulation); toggle enums (On/Off) kept as single cards
  • Category pages: Scheme cards with status badges, computational/data-prep demand indicators, and direct links to individual model card pages
  • Comparison widget: Interactive scheme comparison with category filtering and sortable badges

Dependencies

This PR provides a working prototype of the model cards UI. The current organisation (flat enum-class grouping) is a temporary structure — the proper hierarchical sub-category grouping depends on #972, which introduces sub-options for model physics options.

Test Plan

  • All 22 model cards validate against Pydantic schema
  • RST generator runs without errors
  • make test-smoke passes (13 passed, 2 skipped)
  • Documentation builds successfully
  • Tabbed index renders correctly with expanded per-option cards
  • Interactive comparison widget works in browser

🤖 Generated with Claude Code

- Add Pydantic-based YAML schema for physics scheme model cards
- Create RST generator with sphinx-design directives (tabs, cards, badges)
- Generate 3 pilot model cards: narp (radiation), ohm (storage heat), stebbs (experimental storage heat)
- Integrate bibliography citations using :cite: role
- Add interactive scheme comparison widget with category filtering
- Update meson.build to include model_cards package
- Update Claude rules for conventions

This is the foundational work for comprehensive scheme documentation in SUEWS.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 19, 2026

CI Build Plan

Changed Files

Build system (1 file)

  • src/supy/meson.build

Documentation (32 files)

  • docs/generate_model_cards_rst.py
  • docs/source/index.rst
  • docs/source/scheme-reference/anohm.rst
  • docs/source/scheme-reference/beers.rst
  • docs/source/scheme-reference/biogen_co2.rst
  • docs/source/scheme-reference/boundary_layer.rst
  • docs/source/scheme-reference/co2_vegetation.rst
  • docs/source/scheme-reference/dyohm.rst
  • docs/source/scheme-reference/ehc.rst
  • docs/source/scheme-reference/emissions.rst
  • docs/source/scheme-reference/estm.rst
  • docs/source/scheme-reference/fai.rst
  • docs/source/scheme-reference/gs_model.rst
  • docs/source/scheme-reference/index.rst
  • docs/source/scheme-reference/lumps.rst
  • ...and 17 more

Build Configuration

Configuration
Platforms Linux x86_64, macOS ARM64, Windows x64
Python 3.9, 3.14
Test tier cfg (configuration + smoke)
UMEP build Yes (compiled extension may differ)
PR status Draft (reduced matrix)

Rationale

  • Build system changed -> multiplatform build required
  • Compiled extension ABI may differ -> UMEP (NumPy 1.x) build included

Updated by CI on each push. See path-filters.yml for category definitions.

@github-actions
Copy link

Preview Deployed

Content Preview URL
Site https://suews.io/preview/pr-1210/
Docs https://suews.io/preview/pr-1210/docs/

Note

This preview is ephemeral. It will be lost when:

  • Another PR with site/ or docs/ changes is pushed
  • Changes are merged to master
  • A manual workflow dispatch runs

To restore, push any commit to this PR.

Avoids ambiguity with monetary cost. Updates schema field,
YAML cards, badge labels, and comparison widget.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Single 'demand' badge was ambiguous. Now two independent fields:
- computational_demand: runtime cost per timestep
- data_preparation_demand: effort to gather input parameters

Values for pilot cards:
- narp: compute low, data prep low
- ohm: compute low, data prep medium (needs calibrated coefficients)
- stebbs: compute medium, data prep high (needs building thermal properties)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sunt05 and others added 2 commits February 19, 2026 12:51
Column headers in the comparison widget now link to the
individual model card pages for easy navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Complete the model cards documentation with YAML cards and generated
RST pages for all scheme tiers:

- Tier 1 (13 cards): narp, spartacus, beers, ohm, ehc, dyohm, stebbs,
  qf, biogen_co2, rsl, roughness, stability, lumps
- Tier 2 (7 cards): snow, smd, water_use, gs_model, fai, ohm_inc_qf,
  same_albedo
- Tier 3 (2 deprecated): anohm, estm

Each card documents identity, scientific basis, evaluation evidence,
technical characteristics, operational status, user guidance, and
governance. RST generator produces per-card pages, category indices,
and an interactive comparison widget.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace flat bullet-list index with sphinx-design tab-set grouped by
enum_class. Each tab shows a card grid with badges and descriptions.
Multi-value YAML cards are expanded into per-option cards using enum
docstrings (e.g. StabilityMethod shows 3 separate cards), while
toggle enums (On/Off) remain as single cards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sunt05
Copy link
Author

sunt05 commented Feb 19, 2026

Dependency note: The model cards index currently organises schemes by enum_class in a flat tab layout. This works as a prototype, but the proper hierarchical grouping (e.g. Net Radiation split into forcing / NARP / SPARTACUS families) depends on #972 landing first.

Once #972 introduces sub-options for model physics options, we can restructure the index to reflect the sub-category hierarchy rather than the current flat enum-class grouping.

Blocked by: #972

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.

1 participant