Fit Groups and Multi-colour CSV export

R156 adds controlled inline renaming to the Fit Group registry and exports an already calculated immutable Multi-colour result without reloading observations or recomputing geometry.

Scope and authority

R156 is the current authority for Fit Group label editing and Multi-colour result export inside WLightCurves. It extends, but does not replace, the R154 control-state projection, the R149 formula transaction, or the R144 unified runtime.

The implementation is located in setupobs.py, light_curve_colour_indices.py and light_curve_colour_indices_dialog.py. The dedicated release gate is r156_comet_analyzer_inline_fit_group_csv_release_gate.py.

Inline Fit Group rename

The Fit groups registry remains read-only for ordinary clicks. A double-click opens the standard cell editor only when the clicked cell belongs to the Fit group column.

  • Empty labels are rejected.
  • Labels must remain unique case-insensitively.
  • The immutable group_id is retained.
  • Channel assignments remain attached by group_id.
  • All assignment comboboxes are refreshed with the new display label.
  • An invalid edit restores the last valid registry state.

Add group…, Rename group… and Remove group remain supported. Inline editing is an additional fast path through the same controlled registry operation.

Registry transaction

The displayed label is mutable; identity and assignments are not. Code must route both the explicit rename action and the inline editor commit through the same registry operation. No handler may update table text alone or use a display label as the persistent assignment key.

double-click Fit group cell
→ temporary editor
→ validate label
→ rename registry entry by group_id
→ refresh table and assignment comboboxes
→ preserve channel-to-group identity

CSV result lifecycle

Export CSV… is disabled until Calculate succeeds. The enabled action belongs only to the currently calculated immutable ColourIndexResult.

Changing target, operand A, operand B, UTC bin width or visible-range filtering invalidates that result and disables export. Changing only the plot X axis is render-only: it changes ordering/projection but does not repeat UTC binning or scientific calculation.

Serialization contract

The export is comma-separated UTF-8 with BOM, decimal point notation and ISO 8601 UTC timestamps ending in Z. Rows follow the currently selected axis ordering: Date, Delta T, r or log10(r). Every scientific column is written regardless of the displayed X axis.

target_designation
operand_a_id
operand_a_label
operand_b_id
operand_b_label
bin_width_days
bin_start_utc
bin_end_utc
representative_date_utc
delta_t_days
r_au
log10_r
colour_index_mag
count_a
count_b
scatter_a_mag
scatter_b_mag
uncertainty_mag

Default filename construction sanitizes the canonical target and operand labels, for example multicolour_C_2023_R1_CCD_V_minus_CCD_R_1d.csv.

Invalidation matrix

ChangeExisting resultExportRecalculation
TargetInvalidatedDisabledRequired
Operand A or BInvalidatedDisabledRequired
UTC bin widthInvalidatedDisabledRequired
Visible-range filterInvalidatedDisabledRequired
X axis onlyRetainedEnabledNo; reorder/render only

Performance and scientific boundary

CSV export serializes the committed ColourIndexResult. It performs no observation reload, UTC rebinning, ephemeris call or physical-geometry computation. R156 does not alter input magnitudes, mean(A) - mean(B), UTC binning, stored Delta T/r/log10(r), phase correction, fit mathematics or ephemeris policy.

Release gate and evidence

The supplied report records:

  • R156 release gate: 6/6 PASS;
  • focused R152/R153/R155/R156 regression: 23 passed;
  • R130–R156 regression: 203 passed, 1 skipped;
  • performance validator: PASS for CLEAN and QA;
  • AST validation: CLEAN 123 files and QA 365 files, zero errors;
  • manifests: CLEAN 134 entries and QA 420 entries.

The skip remains the real PyQt5 state-machine test. R156 does not remove the R154 strict Qt qualification requirement, and R161 adds a second strict display-encoding Qt gate. The cumulative package remains PASS_HEADLESS / RC until both offscreen gates and the native R161 smoke pass.

User Fit Group guide · CSV format · Supplied R156 report