Skip to content

Show the model formula in interactive fit dialogs - #10

Merged
PierreRaybaut merged 2 commits into
developfrom
fix/planck-fit-and-domain-coordinates
Oct 20, 2026
Merged

PierreRaybaut merged 2 commits into
developfrom
fix/planck-fit-and-domain-coordinates

Conversation

@PierreRaybaut

@PierreRaybaut PierreRaybaut commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #9

Interactive fit dialogs now show which model is fitted. They also use Sigima's model and starting values for the Planckian and exponential fits.

Changes

  • guifit(..., formula=...) shows the model formula as a selectable rich-text label below the fit parameters (create_formula_label).
  • Every dialog passes the formula of its Sigima fit computer, and parameter labels show the symbols used in it, e.g. "Amplitude (A)", "Scale factor (x₀)", "Base line (y₀)".
  • Polynomial and linear coefficients are labelled a, b, c... as in the formula and in the stored fit_params, instead of c2, c1, c0.
  • Planckian dialog:
    • it uses Sigima's initial guess and bounds: its starting curve now matches the data peak (it was about 147 times too low on blackbody data in meters), and the scale factor no longer starts outside its slider range;
    • σ is now labelled "Temperature factor", because σ / x₀ is proportional to the temperature.
  • Exponential dialog: it evaluates ExponentialFitComputer.evaluate instead of a local modelfunc, and its rate slider uses Sigima's bounds, so short time constants are reachable whatever the X unit.
  • French translations and release notes.

These changes go in the direction of #3 (computation in Sigima, per-type UI presentation) without conflicting with it.

Companion PRs (merge order: Sigima → SigimaX → DataLab)

Validation

  • Full test suite: 257 passed, against the Sigima branch of the same name.
  • New tests check that:
    • each of the 13 dialogs passes its Sigima formula;
    • guifit displays the formula label;
    • the exponential dialog reaches b = -1000, and its stored parameters reproduce the curve;
    • the Planckian dialog starts on the blackbody peak, with every value inside its bounds.
  • Ruff and Pylint (10/10) pass.

guifit() accepts a ormula argument displayed as a selectable rich-text
label below the fit parameters. Every dialog passes the formula of its
Sigima fit computer, and parameter labels show the formula symbols, so
that the parameters stored in the fitted signal metadata can be related
to the model (polynomial coefficients are labelled a, b, c... as in the
metadata).

The Planckian dialog uses Sigima's initial guess and bounds (its initial
curve now matches the data peak) and labels sigma as a temperature
factor. The exponential dialog evaluates Sigima's model and its rate
slider covers short time constants whatever the X unit.

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant