Skip to content

Make the report effect column selectable (report.py hardcodes 'formality') #30

Description

@bamdadd

Context

report.py hardcodes the effect column as _COL_EFFECT = "formality" (see _SWEEP_COLUMNS and _read_sweep_rows). Any sweep whose effect column is sentiment or verbosity — both shipped concepts — cannot be reported without editing the module. The effect column should be selectable.

Proposal

Thread an effect_column parameter through the CSV readers and build_report, defaulting to "formality" so current behaviour is unchanged, and expose a --effect-col CLI flag on steer-report.

Acceptance criteria

  • Replace the hardcoded _COL_EFFECT use in _read_sweep_rows with a parameter; load_dose_curve, load_layer_curve, and build_report accept effect_column: str = "formality".
  • Add --effect-col to steer-report (default formality), passed through to build_report.
  • A clear ValueError naming the available columns when the requested effect column is absent from the CSV (reuse the existing missing-columns check path).
  • CPU-only unit test: a CSV with a sentiment effect column reports correctly when effect_column="sentiment", and a missing column raises the named error. No model download.
  • ruff check ., ruff format --check ., mypy src, pytest -q all pass.

Good first issue: the change is bounded to two functions plus one CLI flag, with existing patterns to copy (the --json flag and the missing-columns check).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions