Skip to content

Commit

Permalink
Test, whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Mar 14, 2024
1 parent 34ec46c commit a87006f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tools/benchcomp/benchcomp/visualizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def _get_template():
return textwrap.dedent("""\
{% for metric, benchmarks in d["metrics"].items() %}
## {{ metric }}
{% if scatterplot and metric in d["scaled_metrics"] and d["scaled_variants"][metric]|length == 2 %}
{%- if scatterplot and metric in d["scaled_metrics"] and d["scaled_variants"][metric]|length == 2 %}
```mermaid
%%{init: { "quadrantChart": { "chartWidth": 400, "chartHeight": 400, "pointRadius": 2, "pointLabelFontSize": 3 }, "themeVariables": { "quadrant1Fill": "#FFFFFF", "quadrant2Fill": "#FFFFFF", "quadrant3Fill": "#FFFFFF", "quadrant4Fill": "#FFFFFF", "quadrant1TextFill": "#FFFFFF", "quadrant2TextFill": "#FFFFFF", "quadrant3TextFill": "#FFFFFF", "quadrant4TextFill": "#FFFFFF", "quadrantInternalBorderStrokeFill": "#FFFFFF" } }%%
quadrantChart
Expand All @@ -255,9 +256,9 @@ def _get_template():
quadrant-2 2
quadrant-3 3
quadrant-4 4
{% for bench_name, bench_variants in d["scaled_metrics"][metric].items () %}
{%- for bench_name, bench_variants in d["scaled_metrics"][metric].items () %}
{{ bench_name }}: [{{ bench_variants[d["scaled_variants"][metric][0]] }}, {{ bench_variants[d["scaled_variants"][metric][1]] }}]
{% endfor %}
{% endfor -%}
```
{% endif %}
Expand Down
15 changes: 14 additions & 1 deletion tools/benchcomp/test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,24 @@ def test_markdown_results_table(self):
run_bc()

self.assertEqual(run_bc.proc.returncode, 0, msg=run_bc.stderr)
self.maxDiff = None
self.assertEqual(
run_bc.stdout, textwrap.dedent("""
## runtime
```mermaid
%%{init: { "quadrantChart": { "chartWidth": 400, "chartHeight": 400, "pointRadius": 2, "pointLabelFontSize": 3 }, "themeVariables": { "quadrant1Fill": "#FFFFFF", "quadrant2Fill": "#FFFFFF", "quadrant3Fill": "#FFFFFF", "quadrant4Fill": "#FFFFFF", "quadrant1TextFill": "#FFFFFF", "quadrant2TextFill": "#FFFFFF", "quadrant3TextFill": "#FFFFFF", "quadrant4TextFill": "#FFFFFF", "quadrantInternalBorderStrokeFill": "#FFFFFF" } }%%
quadrantChart
title runtime
x-axis variant_1
y-axis variant_2
quadrant-1 1
quadrant-2 2
quadrant-3 3
quadrant-4 4
bench_1: [0.0, 1.0]
bench_2: [1.0, 0.0]
```
| Benchmark | variant_1 | variant_2 | ratio |
| --- | --- | --- | --- |
| bench_1 | 5 | 10 | **2.0** |
Expand Down

0 comments on commit a87006f

Please sign in to comment.