Skip to content

Conversation

@SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Jan 8, 2026

Summary

This PR fixes #444 and fixes #634 by adding temporal provenance to job outputs and displaying time information in plot titles.

Key changes:

  • Job.get() now adds start_time and end_time as 0-D coordinates (in ns) to all DataArray outputs, enabling the dashboard to show when data was collected and compute lag
  • Plot titles now display the time range and lag indicator (e.g., "12:34:56.7 - 12:35:02.3 (Lag: 2.1s)")
  • Delta outputs (e.g., "current" counts) set their own time coords representing the period since the last finalize, rather than the entire job duration
  • TemporalBuffer accumulates start_time/end_time as 1-D coordinates per time slice, allowing extractors to compute accurate bounds for windowed views

Note: This is an initial implementation to evaluate the UX. We expect further changes based on feedback, for example:

  • Adjusting what exactly is displayed in the title (format, precision, which time bounds to show)
  • Whether the time info belongs in the plot title or should be displayed elsewhere (e.g., a status bar, tooltip, or dedicated widget)
  • How to handle edge cases like missing time coordinates or very old/stale data

Example

Screenshot 2026-01-08 at 15 08 46

Test plan

  • Unit tests added for Job.get() time coord injection, extractor time handling, and TemporalBuffer accumulation
  • Tests verify that workflows can override job-level times for delta outputs
  • Tests verify that extractors compute correct time bounds from windowed/aggregated data

🤖 Generated with Claude Code

SimonHeybrock and others added 8 commits January 8, 2026 12:49
Job.get() now adds start_time and end_time as 0-D coordinates (unit: ns)
to all DataArrays in the result DataGroup. These coordinates provide
temporal provenance for each output, enabling lag calculation in the
dashboard (lag = current_time - end_time).

Addresses issue #444 and provides foundation for #634.

Prompt: We need to think about how we can address #444 and also take into account #634.
Display data lag (current_time - end_time) in HoloViews plot titles.
The lag shows how old the displayed data is, updating each time the
plot refreshes with new data.

This is a first implementation to evaluate the UX. The lag appears as
"Lag: X.Xs" in the plot title when the data has an end_time coordinate.

Addresses issue #634.
Delta outputs like 'current', 'roi_spectra_current', and counts now have
their own start_time and end_time coords representing the period since
the last finalize, not the entire job duration. This fixes misleading
time display in the dashboard for these outputs.

Changes:
- _add_time_coords() now skips DataArrays with existing time coords
- DetectorView tracks _current_end_time alongside _current_start_time
- All delta outputs get start_time/end_time coords set by the workflow

Prompt: This branch add a time info display by adding and using start_time
and end_time. This works. However, there are workflows such as the detector
views that produce a cumulative and current output... but the start_time is
set to the same for both, misleading the user as to what period was used to
obtain the "current" (delta since last update) counts. Please think about
how to solve this.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The time interval display in plot titles now shows tenths of seconds
(e.g., "12:34:56.7" instead of "12:34:56") for better precision when
monitoring fast-updating data.

Prompt: Consider this branch, in plots.py we should display timestamps to 0.1s precision

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply the same pattern as DetectorView: delta outputs (current, counts_total,
counts_in_toa_range) now have start_time and end_time coords representing
the period since the last finalize. Cumulative outputs do not get these
coords, allowing Job.get() to add job-level times.

Prompt: implement for monitors and commit
The comment suggested 'time' was only kept for backwards compatibility,
but it's an important coord used for timeseries plotting. Also includes
import ordering fixes from ruff.
…t titles

Previously, TemporalBuffer stored start_time/end_time only from the first
item in a "reference", causing plot titles to show stale time information
that didn't reflect the actual data range being displayed.

Now TemporalBuffer accumulates start_time/end_time as 1-D coordinates
(one value per time slice), similar to how it handles the time coordinate.
Extractors compute min/max of these 1-D coords to get accurate scalar
bounds for plot titles.

Changes:
- TemporalBuffer: Add dedicated buffers for start_time and end_time coords
- FullHistoryExtractor: Compute min/max of 1-D time coords
- WindowAggregatingExtractor: Capture time bounds from windowed data before
  aggregation removes the time dimension

Prompt: Please consider changes in this branch. We need to understand how
we handle time-interval display in the plot titles (added in plots.py) in
the case of (a) timeseries plots (extracting full history) and (b) regular
plots with a configured 'window'. In both cases we need to ensure that the
time info is factual. After you understood the problem, I'd like to implement
tests that check for the behavior we desire; if they fail we can think about
how to solve this.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
FullHistoryExtractor and WindowAggregatingExtractor had duplicate logic
for extracting scalar time bounds from 1-D coords. Replaced with a single
_extract_time_bounds_as_scalars helper that both extractors now use.

Prompt: Consider changes in this branch in extractor.py - why is the
implementation different for the window extractor? Can we use the same
helper somehow?

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Display current "lag" of plots vs. the data they show. Include start_time and end_time in result messages.

3 participants