Skip to content

Unify cumulative/current outputs behind user-facing views (#932)#935

Draft
SimonHeybrock wants to merge 1 commit into
mainfrom
worktree-932-output-view-unification
Draft

Unify cumulative/current outputs behind user-facing views (#932)#935
SimonHeybrock wants to merge 1 commit into
mainfrom
worktree-932-output-view-unification

Conversation

@SimonHeybrock
Copy link
Copy Markdown
Member

Summary

Closes #932.

  • Replace the (cumulative) / (current) output split with one user-facing view per quantity.
  • Move the cumulative-vs-update choice into the window-mode plot parameter as a new since_start mode; the mode now drives which backend stream the plot subscribes to.
  • Drop the parenthetical qualifier from plot titles and axis labels; window state is shown next to the title.

Design

  • OutputView (in workflow_spec.py) binds one user-facing title to 1..N pydantic field names, keyed by StreamRole (since_start, per_update). Outputs classes declare views via an output_views ClassVar; classes that don't declare any get one view per field via fallback. Reduction outputs (LOKI, Estia, Bifrost, Dummy) need no annotation.
  • WindowMode.since_start added. Mode availability per view: since_start requires the corresponding stream role; latest / window require per_update. For cumulative-only views the window widget collapses.
  • DataSourceConfig.output_nameview_name. PlotOrchestrator resolves (view_name, window_mode) → backend_field at subscribe time. The wire-format ResultKey.output_name and all pydantic field names are unchanged.
  • Plot title resolver maps backend field names back to view titles for legend / Y-axis labels.

Migration

  • The 5 checked-in grid templates have been migrated.
  • User-saved layouts persisted in the legacy output_name schema log a warning and are skipped; users reconfigure those plots.

Test plan

  • pytest tests/ (3324 passed locally)
  • Smoke-test the dashboard against a running backend, verifying:
    • Each output appears once in the wizard with no (cumulative) / (current) qualifier
    • Switching window mode between since_start / latest / window produces the correct data
    • Cumulative-only outputs (e.g. I(Q)) show no window widget
    • Migrated grid templates load and render correctly

Replace the `(cumulative)` / `(current)` output split with a single view per
quantity. The cumulative-vs-update choice now lives in the window-mode plot
parameter as a new `since_start` mode, which drives which backend stream the
plot subscribes to. Plot titles and axis labels drop the qualifier; window
state is shown alongside in the toolbar.

`OutputView` bundles one user-facing title with the backend pydantic fields
that back it for each `StreamRole` (`since_start`, `per_update`). Outputs
without a declared `output_views` ClassVar fall back to one view per field,
so reduction-style outputs (LOKI, Estia, Bifrost, Dummy) need no annotation.

`DataSourceConfig` carries `view_name` (was `output_name`); the orchestrator
resolves view + window mode to the backing field at subscribe time. The
wire-format `ResultKey.output_name` and pydantic field names are unchanged.

Grid templates and `PlotConfig` serialisation use `view_name`; layers
persisted in the legacy `output_name` schema are skipped with a warning so
users reconfigure them rather than silently render broken data.
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.

"Latest" in the monitor workflow does not correspond to the latest monitor histogram in kafka

1 participant