Reports (rpx_benchmark.reports)¶
JSON + markdown serialisation of BenchmarkResult +
DeploymentReadinessReport.
reports
¶
Result serialisation: JSON + markdown summary for benchmark runs.
write_json(path: str | Path, *, task: str, model_name: str, split: str, repo_id: str, result: BenchmarkResult, dr_report: DeploymentReadinessReport | None = None, extra: Dict[str, Any] | None = None) -> Path
¶
Serialise a benchmark result + deployment report to JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
Output file path. Parent directories are created if missing. |
required |
task
|
str
|
Task name string (e.g. |
required |
model_name
|
str
|
Display name of the model under test. |
required |
split
|
str
|
ESD difficulty split ( |
required |
repo_id
|
str
|
HuggingFace dataset repo id the samples came from. |
required |
result
|
BenchmarkResult
|
Per-sample + aggregated metric container returned by
:class: |
required |
dr_report
|
DeploymentReadinessReport
|
Weighted Phase Score, STR, TS, efficiency metadata. Omitted
when |
None
|
extra
|
dict
|
Arbitrary free-form extra fields to embed under the |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The resolved output path, for chaining. |
Notes
Dataclasses are converted via :func:dataclasses.asdict, enums
are lowered to their .value, and unknown objects pass through
unchanged. The output is pretty-printed with indent=2 for
diff-friendliness.
Source code in rpx_benchmark/reports.py
format_markdown_summary(*, task: str, model_name: str, split: str, repo_id: str, result: BenchmarkResult, dr_report: DeploymentReadinessReport | None = None) -> str
¶
Render a benchmark result as a human-readable markdown report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
str
|
|
required |
model_name
|
str
|
|
required |
split
|
str
|
|
required |
repo_id
|
str
|
|
required |
result
|
BenchmarkResult
|
|
required |
dr_report
|
DeploymentReadinessReport
|
When provided, the output includes the Weighted Phase Score table, State-Transition Robustness deltas, Temporal Stability score, and an Efficiency table (params, FLOPs, latency). |
None
|
Returns:
| Type | Description |
|---|---|
str
|
A Markdown-formatted report. Matches the terminal UI tables the CLI prints so on-disk reports and terminal output stay in sync. |
Examples:
>>> from rpx_benchmark.reports import format_markdown_summary
>>> md = format_markdown_summary(
... task="monocular_depth", model_name="depth_pro",
... split="hard", repo_id="IRVLUTD/rpx-benchmark",
... result=result, dr_report=report,
... )
Source code in rpx_benchmark/reports.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |