Comet Analyzer automatic range and invalidation
R163 centralizes ownership of manual plot limits and defines when a committed range remains valid as the rendered dataset, transforms, formulas and filters change.
Status: R163 PASS. Historical R154 and R161 real-PyQt5 gates remain PASS_HEADLESS because PyQt5 was unavailable on the build host.
AUTO and USER modes
AnalyzerRangeMode.AUTO means no explicit limits are authoritative; the renderer derives a new range from the current visible scientific content. AnalyzerRangeMode.USER means the four valid range fields were deliberately edited and committed with Refresh.
A USER range is retained only while its complete AnalyzerRangeIdentity remains unchanged. A changed identity resolves to AUTO and removes explicit limits.
Immutable rendered-data identity
AnalyzerRangeIdentity fingerprints the data and transformations that can change rendered rows or coordinates. Ordering of targets, channels, observers and returns is normalized, so a pure reorder does not invalidate a manual range. Formula fingerprinting uses the complete sorted per-target document and is independent of the current Editing target.
Inputs that invalidate a USER range
- loaded-observation fingerprint;
- selected target set and enabled target/return identities;
- visible channel IDs and enabled observers;
- uncertain and negative-observation filters;
- X-axis projection and magnitude mode;
- phase-correction state, phase display mode and dust
d_90; - complete Regular and Additional formula documents for every selected target.
New target selection invalidates explicitly. Reloaded data are detected when the committed observation fingerprint changes.
Inputs deliberately excluded from range identity
- comet and channel colours or markers;
- global observation Point size;
- display-encoding mode and legend layout;
- FitGroup labels, membership and enabled state;
- Editing-target navigation;
- Bortle reference-line visibility.
These changes may rebuild artists or fit organization, but they do not change the coordinates that own the current manual range.
Range-field intent tracking
The four fields record Qt textEdited events without redrawing. This distinguishes deliberate user input from values written programmatically by the renderer.
- deliberately edited valid values plus Refresh commit USER limits;
- unedited stale field values are ignored after an identity change, so Refresh requests AUTO limits;
- programmatic field updates clear the dirty flag.
Central range resolution
DoPlotUpdate(), _analysis_start_plot() and _render_current_view() resolve limits through the same Qt-free contract. Historical internal four-value lists are accepted only when they still belong to the unchanged USER identity.
This prevents a previously committed range from leaking across target, data, filter, transform or formula changes while avoiding unnecessary resets for style-only actions.
R182 cached Auto range command
Auto range restores the cached automatic view through the current committed dataset and range state. It is view-only and must not reload observations, rerun fits, recompute formula documents or request geometry.
R181 automatic X/Y envelope
- Resolve selected targets, returns, visible observation channels, observers and quality filters.
- Transform the visible observations into the current X and magnitude projections.
- Derive automatic X exclusively from those visible observations.
- Within that fixed X interval, derive automatic Y from visible observations plus applicable regular models, additional formulas and the Bortle reference.
Models, formulas and Bortle may never enlarge automatic X. An explicit validation error remains appropriate when no visible observations define an X interval.
Settings classification
Range invalidation is limited to settings that can change displayed rows or coordinates: uncertain/negative rejection, phase correction, phase display mode, dust d_90, return selection, observer selection and channel Show.
Fit-only settings, Bortle-reference visibility and display-style changes redraw without resetting limits.
Acceptance examples
- Leaving only CCD V and CCD R visible discards stale manual limits and repopulates the fields from the new visible content.
- Switching display encoding, changing a colour/marker or changing Point size preserves the range.
- Newly downloaded observations change the observation fingerprint and recompute AUTO limits.
- Changing
d_90, phase correction, axis, magnitude mode or formula content recomputes AUTO limits unless the user commits new values. - Changing FitGroup membership or Editing target preserves the range.
R163/R181/R182/R187 validation
R163 protects AUTO/USER identity and invalidation. R181 protects the observation-X/model-Y envelope. R182 protects the cached Auto range action. R187 composes those gates into the final 1..N Comet Analyzer qualification.