Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/rtichoke/summary_report/summary_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ def _create_browser_summary_report(
"title": "By Probability Threshold",
"components": [
{"id": "roc", "title": "ROC", "spec": roc_thresh_spec},
{"id": "lift", "title": "Lift", "spec": lift_thresh_spec},
{
"id": "precision-recall",
"title": "Precision-Recall",
Expand All @@ -551,14 +552,14 @@ def _create_browser_summary_report(
"title": "Gains",
"spec": gains_thresh_spec,
},
{"id": "lift", "title": "Lift", "spec": lift_thresh_spec},
],
},
{
"id": "discrimination-ppcr",
"title": "By PPCR",
"title": "By Predicted Positives Condition Rate (PPCR)",
"components": [
{"id": "roc-2", "title": "ROC", "spec": roc_ppcr_spec},
{"id": "lift-2", "title": "Lift", "spec": lift_ppcr_spec},
{
"id": "precision-recall-2",
"title": "Precision-Recall",
Expand All @@ -569,7 +570,6 @@ def _create_browser_summary_report(
"title": "Gains",
"spec": gains_ppcr_spec,
},
{"id": "lift-2", "title": "Lift", "spec": lift_ppcr_spec},
],
},
],
Expand Down Expand Up @@ -607,7 +607,7 @@ def _create_browser_summary_report(
},
{
"id": "performance-table-ppcr",
"title": "By PPCR",
"title": "By Predicted Positives Condition Rate (PPCR)",
"components": [
{
"id": "performance-table-2",
Expand All @@ -620,7 +620,7 @@ def _create_browser_summary_report(
},
]

report = _build_report_spec_v11(sections, title="rtichoke summary report")
report = _build_report_spec_v11(sections, title="Summary Report")
return RtichokeBrowserReport(cast(dict[str, Any], report)).write_html(output_file)


Expand Down
17 changes: 15 additions & 2 deletions tests/test_summary_report_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ def test_browser_summary_report_structure_and_component_counts(tmp_path):

report = _embedded_report(output.read_text(encoding="utf-8"))

# Exact report title
assert report["title"] == "Summary Report"

# Exactly 6 sections
sections = report["sections"]
assert len(sections) == 6
Expand Down Expand Up @@ -524,25 +527,35 @@ def test_browser_summary_report_structure_and_component_counts(tmp_path):
# Discrimination Group 1: By Probability Threshold
disc_grp_thresh = disc_items[1]
assert disc_grp_thresh["id"] == "discrimination-probability-threshold"
assert disc_grp_thresh["title"] == "By Probability Threshold"
disc_thresh_comps = disc_grp_thresh["components"]
assert [c["id"] for c in disc_thresh_comps] == [
"roc",
"lift",
"precision-recall",
"gains",
"lift",
]

# Discrimination Group 2: By PPCR
disc_grp_ppcr = disc_items[2]
assert disc_grp_ppcr["id"] == "discrimination-ppcr"
assert disc_grp_ppcr["title"] == "By Predicted Positives Condition Rate (PPCR)"
disc_ppcr_comps = disc_grp_ppcr["components"]
assert [c["id"] for c in disc_ppcr_comps] == [
"roc-2",
"lift-2",
"precision-recall-2",
"gains-2",
"lift-2",
]

# Performance Table section
perf_sec = sections[5]
assert perf_sec["id"] == "performance-table"
perf_items = perf_sec["items"]
assert len(perf_items) == 2
assert perf_items[0]["title"] == "By Probability Threshold"
assert perf_items[1]["title"] == "By Predicted Positives Condition Rate (PPCR)"

# Collect all component IDs across report
all_comp_ids = []
for sec in sections:
Expand Down
Loading