bencher.scorecard.discover

Discover benchmark summaries and reports under a reports directory.

Walks <reports_dir>/<layout.root>/<tag>/ collecting the machine-readable *.summary.json (result_to_dict() with series) for the scorecard table, and the HTML reports for the “reports without metrics” link section. All project specifics — the tag registry and the on-disk layout — come from the ScorecardConfig.

Functions

tag_to_name(→ str)

Fallback display name for an unregistered tag (strip prefix, title-case).

_resolve(→ tuple[str, str])

Return (category, display_name) for a tag from the registry or fallback.

discover_summaries(→ list[dict])

Parse every *.summary.json under the reports root.

_discover_html_reports(→ list[dict])

One {tag, name, category, link} per tag dir with an HTML report.

discover_report_links(→ list[dict])

Benchmarks with an HTML report but no scalar metrics, grouped by category.

Module Contents

bencher.scorecard.discover.tag_to_name(tag: str) str

Fallback display name for an unregistered tag (strip prefix, title-case).

bencher.scorecard.discover._resolve(tag: str, config: bencher.scorecard.config.ScorecardConfig) tuple[str, str]

Return (category, display_name) for a tag from the registry or fallback.

bencher.scorecard.discover.discover_summaries(reports_dir: pathlib.Path, config: bencher.scorecard.config.ScorecardConfig) list[dict]

Parse every *.summary.json under the reports root.

Returns one record per summary file with registry metadata attached, in deterministic (category order, then display name) order. Benchmarks with no scalar metrics and malformed JSON are skipped.

bencher.scorecard.discover._discover_html_reports(reports_dir: pathlib.Path, config: bencher.scorecard.config.ScorecardConfig) list[dict]

One {tag, name, category, link} per tag dir with an HTML report.

Benchmarks with an HTML report but no scalar metrics, grouped by category.

The scorecard charts only benchmarks that emit scalar metrics; image-only reports and any report whose summary is missing would otherwise be unreachable. Drops any tag already shown as a metric row. Returns [{category, links: [{name, link}]}] in category display order.