Skip to content

fix: reloaded fit curve does not match the originally displayed fit #25

Description

@ahmadomira

Summary

When a saved fit is reloaded (e.g. to restyle the plot), the drawn fit line does not match what was displayed during the original fit. Investigate the root cause and fix the fit-curve reconstruction on import so the reloaded Median Fit curve matches the original exactly. Likely areas: the dense fit curve (FitResult.x_fit / y_fit vs a recomputed _dense_fit_curve), prepare_plot_data, and the import path in fitting_session.py.

Source

Reported via the fitting-app feedback channel. (Screenshots were attached to the original report.)

Acceptance criteria

  • A reloaded fit renders a Median Fit curve identical to the original (within float tolerance).
  • A regression test reproduces the mismatch and then passes.
  • uv run ruff check / format clean.

Scope & file boundaries

Package D (first in the plotting chain). Touch:

  • gui/plotting/plot_widget.py
  • core/data_processing/plotting.py
  • gui/fitting_session.py
  • core/pipeline/fit_pipeline.py

Parallelization

Package D — runs in parallel with packages A, B, C. Packages E and F depend on this PR being merged first (they edit the same plotting files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparallel-batchPart of a parallel work-package batch

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions