Skip to content

feat: server-side time-series downsampling + dashboard/API cleanup - #2

Merged
simontaurus merged 1 commit into
mainfrom
feat/server-side-downsampling
Jul 6, 2026
Merged

feat: server-side time-series downsampling + dashboard/API cleanup#2
simontaurus merged 1 commit into
mainfrom
feat/server-side-downsampling

Conversation

@simontaurus

Copy link
Copy Markdown
Contributor

Summary

Downsample large time series on the server (pgstack downsample_tool_channel RPC) and transport only what the plot can show, driven from the dashboard zoom. Plus a set of dashboard and API cleanups.

Downsampling

  • DownsampleParams (sample / average / minmax, max_points, bin_size, edge_anchors) on the read/load params.
  • PostgrestDatabaseDriver routes to the RPC with graceful fallback (missing RPC / older stack / SQLite all still work); LocalDatabaseDriver stride-decimates.
  • View: per-channel method resolution, cache bypass while downsampling, and a "Load current range" button that re-fetches the box-zoomed window at finer resolution.

Dashboard fixes

  • Link plot x-ranges via one shared DataRange1d created at figure build (a deferred reassignment raced the render and left some plots unlinked).
  • Bridge the Reset event through a ColumnDataSource + CustomJS (figure.on_event(Reset) does not reach the server through Panel).
  • Fit the Wunderbaum tree to the sidebar (was overflowing to a fixed 800px).

API / cleanup

  • auto_fetch now respects the end picker (no longer pins the end to now); the live view keeps its own now-window and is unaffected.
  • High-level bulk store store_channel_data_bulk + a shared seed helper (_demo_data) used by demo/bench/tests; consolidated the Playwright screenshot helpers into docs/_screenshot_utils.py.
  • Config models use plain pydantic BaseModel; the param classes are re-exported from the user-facing module so callers need not import the mixin.
  • Consolidated read_tool_channel_raw into the concrete TSDCMixin (no v1/v2 override duplication).

Tests / assets

  • Unit tests + gated pgstack integration tests + a benchmark; the downsampling demo; regenerated screenshots and README section.

Verified: offline suite (incl. new bulk-store + config round-trip), 8 integration tests against a live pgstack, and a demo smoke run.

Note: the .content scroll relies on opensemanticworld/panelini#37.

Downsample large series on the server (pgstack downsample_tool_channel RPC)
and transport only what the plot can show, driven from the dashboard zoom.

- read path: DownsampleParams (sample/average/minmax, max_points, bin_size,
  edge_anchors) on the read/load params; PostgrestDatabaseDriver routes to the
  RPC with graceful fallback; LocalDatabaseDriver stride-decimates; per-channel
  method resolution, cache bypass, and "Load current range" zoom reload.
- dashboard fixes: link plot x-ranges via one shared DataRange1d at figure
  creation; bridge the Reset event through a ColumnDataSource (on_event does not
  reach the server through Panel); fit the Wunderbaum tree to the sidebar.
- auto_fetch respects the end picker (no longer pins end to now); the live view
  keeps its own now-window, so it is unaffected.
- high-level bulk store (store_channel_data_bulk) + shared seed helper
  (_demo_data) used by demo/bench/tests; consolidate the screenshot helpers.
- config models use plain pydantic BaseModel; re-export the param classes from
  the user-facing module so callers need not import the mixin.
- consolidate read_tool_channel_raw into the concrete TSDCMixin (no v1/v2
  override duplication).
- add unit + gated integration tests, a benchmark, the downsampling demo, and
  regenerated screenshots/README.
@simontaurus
simontaurus merged commit 2219184 into main Jul 6, 2026
5 of 9 checks passed
@simontaurus
simontaurus deleted the feat/server-side-downsampling branch July 6, 2026 04:19
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