This commit is contained in:
@@ -177,7 +177,7 @@ def test_plot_display_variant_exports(comparison, tmp_path, colors, anonymize):
|
||||
for name in ("performance_energy_compact", "speedup_compact_comparison"):
|
||||
svg = (tmp_path / f"svg/{name}.svg").read_text()
|
||||
if name == "performance_energy_compact":
|
||||
assert ("Anonimized better" in svg) == anonymize
|
||||
assert ("ANON better" in svg) == anonymize
|
||||
assert ("Raptor better" in svg) == (not anonymize)
|
||||
svg_colors = re.findall(r"(?:fill|stroke):\s*#([0-9a-fA-F]{6})", svg)
|
||||
assert svg_colors
|
||||
@@ -207,9 +207,9 @@ def test_anonymization_reaches_all_plot_labels(comparison, monkeypatch):
|
||||
comparison.main()
|
||||
assert len(captured) == 30
|
||||
assert all("Raptor" not in label for labels in captured.values() for label in labels)
|
||||
assert "Anonimized pipeline stages" in captured["raptor_pipeline_throughput"]
|
||||
assert "Anonimized better →" in captured["performance_energy_compact"]
|
||||
assert "Anonimized\n2 stages" in captured["validation_status"]
|
||||
assert "ANON pipeline stages" in captured["raptor_pipeline_throughput"]
|
||||
assert "ANON better →" in captured["performance_energy_compact"]
|
||||
assert "ANON\n2 stages" in captured["validation_status"]
|
||||
finally:
|
||||
comparison.configure_style()
|
||||
|
||||
@@ -262,6 +262,8 @@ def test_repeated_pimcomp_batch_results_must_agree(comparison, comparison_csv, t
|
||||
fields, rows = comparison_csv
|
||||
row = next(row for row in rows if row["arch"] == "arch-a" and row["model"] == "vgg8"
|
||||
and row["raptor_pipeline"] == "4")
|
||||
if field == "pimcomp_functional_validation" and row[field] == value:
|
||||
value = "PASS"
|
||||
row[field] = value
|
||||
with pytest.raises(ValueError, match="inconsistent shared PIMCOMP batch results"):
|
||||
comparison.load_results(write_csv(tmp_path / "results.csv", fields, rows))
|
||||
|
||||
@@ -102,7 +102,7 @@ configurations are rejected before plots are written.
|
||||
|
||||
Charts use the pastel palette and the Raptor name by default.
|
||||
Use `--no-colors` for grayscale output; `--colors` explicitly enables colors.
|
||||
Use `--anonymize` to replace displayed `Raptor` labels with `Anonimized`;
|
||||
Use `--anonymize` to replace displayed `Raptor` labels with `ANON`;
|
||||
`--no-anonymize` explicitly keeps the Raptor name. The flags are independent.
|
||||
Use `--no-marker-borders` for solid markers without outlines in the compact dot
|
||||
plot and line chart, including their legends. These markers use the darker
|
||||
|
||||
@@ -657,7 +657,7 @@ def main() -> None:
|
||||
parser.add_argument("--colors", action=argparse.BooleanOptionalAction, default=True,
|
||||
help="Use the pastel palette (default); --no-colors exports grayscale charts")
|
||||
parser.add_argument("--anonymize", action=argparse.BooleanOptionalAction, default=False,
|
||||
help="Replace the displayed Raptor name with Anonimized")
|
||||
help="Replace the displayed Raptor name with ANON")
|
||||
parser.add_argument("--marker-borders", action=argparse.BooleanOptionalAction, default=True,
|
||||
help="Outline markers (default); --no-marker-borders uses solid markers in dot and line charts")
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -109,7 +109,7 @@ class CenteredHatch(AbstractPathEffect):
|
||||
def configure_style(*, colors: bool = True, anonymize: bool = False) -> None:
|
||||
global _USE_COLORS
|
||||
_USE_COLORS = colors
|
||||
COMPILER_NAMES["raptor"] = "Anonimized" if anonymize else "Raptor"
|
||||
COMPILER_NAMES["raptor"] = "ANON" if anonymize else "Raptor"
|
||||
plt.rcParams.update({
|
||||
"font.family": "DejaVu Sans",
|
||||
"axes.spines.top": False,
|
||||
|
||||
Reference in New Issue
Block a user