Skip to content

Generate and publish a validation summary - #120

Merged
roshan2004 merged 1 commit into
mainfrom
generated-validation-summary
Jun 10, 2026
Merged

Generate and publish a validation summary#120
roshan2004 merged 1 commit into
mainfrom
generated-validation-summary

Conversation

@roshan2004

Copy link
Copy Markdown
Owner

What

The validation work is strong but invisible: the suite cross-checks geometry/RMSD/contacts vs MDAnalysis, bonds/chemistry/descriptors vs RDKit, secondary structure vs mkdssp, pocket interactions vs PLIP, plus a tier of physical invariants — yet the results only ever landed in the CI log. This makes them legible.

A small pytest plugin records the pass / skip / fail outcome of every validation check (including whole modules skipped because a reference tool is absent) and, when run with --validation-summary-dir=DIR, writes:

  • validation-summary.md — a table of area · reference · passed/skipped/failed, with per-check detail for anything skipped or failed
  • validation-summary.json — the same data, machine-readable
uv run pytest tests/validation -v -rs -s --validation-summary-dir=.

Generated, so it can't drift

Every count comes from the run itself — the summary is produced by the tests, not authored alongside them. Only the human-readable area labels live in tests/validation/_summary.py; new *_ref modules are picked up automatically with a fallback label.

Visible in CI

The validation job now:

  • runs with --validation-summary-dir=.,
  • cats the Markdown into $GITHUB_STEP_SUMMARY so it renders on the workflow run page (Summary tab), and
  • uploads both files as the validation-summary artifact (if: always(), so a failing check still publishes — you see exactly which one).

That run, with all reference tools installed, is the authoritative snapshot of what is currently cross-checked.

Example (generated locally)

**121 checks: 112 passed, 9 skipped, 0 failed.**

| Area | Reference | Passed | Skipped | Failed |
| Geometry, RMSD, distances, inertia | MDAnalysis | 10 | 0 | 0 |
| Bond perception from geometry | RDKit | 19 | 0 | 0 |
| Secondary structure (simplified DSSP) | mkdssp | 6 | 0 | 0 |
| ... |

Design notes

  • Plugin, not a new dep: hooks pytest_runtest_logreport (per-test pass/fail/skip) and pytest_collectreport (whole modules skipped when a tool is missing). No pytest-json-report dependency.
  • Inert by default: without --validation-summary-dir the plugin records nothing user-visible and writes no files, so normal pytest runs are unchanged.
  • In docs vs artifact: the always-fresh CI artifact + run-page summary is the source of truth (no committed snapshot to go stale); docs/validation.md gains a "Generated summary" section explaining and linking it.

Tests & docs

  • tests/validation/test_summary_generator.py — 6 unit tests for the pure aggregation/formatting (runs in the normal suite; no reference tools needed).
  • Generated locally end-to-end (112 passed / 9 skipped) to confirm the plugin and skip-reason capture work.
  • Full suite: 932 passed, 21 skipped (no regressions); ruff clean; ci.yml validated.
  • Docs: docs/validation.md "Generated summary" section, README "Scientific validation" footer, CHANGELOG.

The validation suite already cross-checks geometry/RMSD/contacts vs
MDAnalysis, bonds/chem/descriptors vs RDKit, secondary structure vs
mkdssp, pocket interactions vs PLIP, and a tier of physical invariants —
but the results only landed in the CI log. This surfaces them.

A small pytest plugin (tests/validation/conftest.py) records the
pass/skip/fail outcome of every validation check (including whole modules
skipped because a reference tool is absent) and, when run with
--validation-summary-dir=DIR, writes validation-summary.{md,json}. The
summary is derived entirely from the run, so it cannot drift from the
tests; only the human area labels live in tests/validation/_summary.py.

CI now runs the validation job with that flag, prints the Markdown to the
workflow run page (GITHUB_STEP_SUMMARY) and uploads both files as the
validation-summary artifact — so the scientific boundaries are visible at
a glance without trawling the logs.

Adds unit tests for the pure formatting (test_summary_generator.py, runs
in the normal suite, no reference tools needed) and documents it in
docs/validation.md, the README, and the CHANGELOG.
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 molscope | 🛠️ Build #33073004 | 📁 Comparing b204402 against latest (3bf3ea1)

  🔍 Preview build  

1 file changed
± validation/index.html

@roshan2004
roshan2004 merged commit c4848b0 into main Jun 10, 2026
11 checks passed
@roshan2004
roshan2004 deleted the generated-validation-summary branch June 10, 2026 10:19
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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