Skip to content

modules: ask for the fit settings in a form before fitting - #32

Merged
YPARK merged 1 commit into
mainfrom
fit-form
Oct 18, 2026
Merged

YPARK merged 1 commit into
mainfrom
fit-form

Conversation

@YPARK

@YPARK YPARK commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

What

faba modules in a terminal now asks for the blockmodel's settings before it fits. That happens when there are no tables yet, with --refit, or when the settings given differ from the run record.

  • Rows: model preset, cell and gene roles, chains, sweeps, burn-in, thin, seed, profile strength, global weights, shift, cell sd, alphas, shift sd, holdout.
  • Prefill: the flags given, else the preset's defaults. Switching the preset refills only the rows the user has not set; r resets a row.
  • Checking: after every key the settings go through clap and the same cluster checks as the CLI. The reason shows beside the row it names and in full in the status line, and Ctrl+R stays blocked until the settings pass.
  • Keys: Ctrl+R fits (also from a row being typed), Enter only types or steps a choice, Esc goes back (opening the old tables if there are any, as the footer says), Ctrl+C quits.
  • The fit, the run record and the saved {m}_blockmodel.cmd.sh use the values chosen.
  • Batch mode (--batch-process, --html) and non-terminal runs skip the form and use the flags as before.

Refactor

The pipeline's generic flag form moves from pipeline/tui/form.rs to crate::tui::form, so the pipeline Flags screen and the fit form share the form model, the parsing and the row drawing.

Tests

New tests in cluster/browse/tests/ask.rs cover prefill, preset refill, blocked invalid settings (with the reason in the blocked note), Ctrl+R with edited and in-progress values, Esc vs Ctrl+C, the footer's Esc label, defaults given as flags, and batch mode skipping the form. The existing pipeline form tests pass. Checked live in a terminal on a small sample.

In a terminal, faba modules now shows the blockmodel's settings before it
fits (no tables yet, --refit, or settings that differ from the record).
Rows are prefilled from the flags given, else the preset's defaults; a
preset switch refills the rows the user has not set. Every key re-checks
the settings with clap and the cluster checks, the reason is shown beside
the row and in the status line, and Ctrl+R is blocked until they pass.
Ctrl+R fits, Esc goes back (to the old tables when there are any), Ctrl+C
quits. The fit, the run record and the saved command use the values
chosen. Batch mode and non-terminal runs use the flags as before.

The pipeline's generic flag form moves to crate::tui::form so both
screens share it, including the row drawing.
@YPARK
YPARK merged commit aeae615 into main Oct 18, 2026
6 checks passed
@YPARK
YPARK deleted the fit-form branch October 18, 2026 18:08
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