Skip to content

Move the marginal-check numerics out of the GUI stage #17

Open

Description

@jtravs

What is wrong

The marginal-check stage of the GUI (croak/gui/stage_marginal_check.py) computes physics: _predict (trust-window taper, resampling onto a frequency grid, the predicted marginal and its centroid), _measured_moments, and the width-bracket judgement in _annotate_checks. AGENTS.md asks that GUI modules hold Qt glue, not numerics, and that plot data be prepared outside the GUI.

Why it matters

The same check cannot be run from a script or the CLI, and its numerics are tested only through the widget. A headless function would let croak.session report the check in a replayed session too.

What done looks like

A Qt-free function (in croak.marginal_checks, beside predicted_marginal) that takes the loaded data and the trust region and returns the measured and predicted curves, centroids and the width verdict; the stage only draws it and writes its summary. Tests move with it.

Context

Found while moving the stage's plots to pyqtgraph in #16, which left the computation where it was to stay in scope. Read, not run, beyond the existing tests.

Suggested labels: refactor, area: gui, area: preprocessing, priority: low.

Activity

  1. added
    refactorInternal restructuring with no change in behaviour
    area: preprocessingLoading, preprocessing, delay origin and marginal checks
    on Nov 5, 2026
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

    area: guiThe Qt wizardarea: preprocessingLoading, preprocessing, delay origin and marginal checkspriority: lowWorth doing, no hurryrefactorInternal restructuring with no change in behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions