Skip to content

Generalize ReportCreator to configurable grouping and value columns - #182

Merged
henba1 merged 1 commit into
mainfrom
henba1-report-creator-configurable
Jul 26, 2026
Merged

henba1 merged 1 commit into
mainfrom
henba1-report-creator-configurable

Conversation

@henba1

@henba1 henba1 commented Jul 10, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Let ReportCreator plot the robustness distribution along any dimension, instead of being hard-coded to network / epsilon_value.

What changed vs. the old ReportCreator

  • Configurable columns. New keyword-only args on __init__: group_by (the hue / split), value_column (the plotted value), and value_label (axis label). Defaults are "network" / "epsilon_value", so existing call sites behave exactly as before — e.g. group_by="attack" now overlays attacks.
  • Shared _finalize() helper. Every figure method previously repeated get_figure() + plt.close() with no axis labels. Labelling is now centralized: consistent x/y labels, a title, and a legend titled by the grouping column.
  • Proper labels/titles. Old plots had unlabeled axes and no titles (box only rotated ticks). All four plots (hist, box, kde, ecdf) plus create_anneplot now emit readable labels/titles derived from the column names.
  • Docstrings + return annotations added for the class and helpers.

Testing

  • Existing tests/test_analysis/test_report_creator.py (all 5) pass unchanged — confirms backward compatibility.
  • ruff check and ruff format --check clean.

Make ReportCreator plot along any dimension instead of hard-coded
network / epsilon_value. Adds keyword-only group_by, value_column and
value_label args (defaults preserve existing behaviour), a shared
_finalize() helper for consistent axis labels / titles / legends, and
docstrings + return annotations. All existing tests pass unchanged.
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@henba1
henba1 requested a review from Aaron99B July 10, 2026 20:18
@henba1 henba1 self-assigned this Jul 10, 2026
@henba1 henba1 added the enhancement New feature or request label Jul 10, 2026
@henba1
henba1 merged commit 0cc755f into main Jul 26, 2026
4 checks passed
@henba1
henba1 deleted the henba1-report-creator-configurable branch July 26, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants