spacr.qt.widgets.refit_dialog

Pick another model for the screen already on screen.

Use the regression plot’s context menu to choose another model, correction method, or FDR threshold.

THIS DIALOG STARTS A FIT. Everything else reachable by right-clicking a plot changes how it looks, so this one has to read differently: it names the model the table on screen was fitted with, it says WHERE the new run will write, and it says in advance which settings it is about to reset – all before the OK button does anything.

The reset sentence is the one that matters. Switching from a penalised model to an unpenalised one drops the penalty weight, because the fit refuses to accept a number it cannot read (spacr.ml._reject_unused_settings()), and a user who reads “alpha” on the settings panel afterwards is entitled to have been told rather than to work it out from a folder name.

Classes

RefitDialog

Choose a regression type, a correction and a penalty weight.

Functions

ask_refit(→ Optional[tuple])

Show the dialog; return (settings, notes) or None if cancelled.

Module Contents

class spacr.qt.widgets.refit_dialog.RefitDialog(settings: dict, parent=None)[source]

Bases: PySide6.QtWidgets.QDialog

Choose a regression type, a correction and a penalty weight.

Parameters:
  • settings – the settings the run on screen used. Read only; the new dict is built by spacr.refit.refit_settings().

  • parent – parent widget; ownership only.

chosen() → dict[source]

{regression_type, correction_method, level, alpha} as picked.

None for anything left at “as before”, which is what spacr.refit.refit_settings() reads as “leave it alone”.

settings()[source]

(settings, notes) for the new run, or raises ValueError.

spacr.qt.widgets.refit_dialog.ask_refit(settings: dict, parent=None) → tuple | None[source]

Show the dialog; return (settings, notes) or None if cancelled.

Parameters:

settings – the settings the run on screen used; read only, and passed to RefitDialog.