DiamondLightSource / DiamondLightSource/smartem-frontend

Server-side windowing/downsampling for model-weight history

Open
#128 0 comments 0 reactions 0 assignees View on GitHub
development
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
13h 22m
Merged PRs (30d)
4

Description

## Context

PR #127 (closing the last two items of #67) added an *"as of {timestamp}"* time-slider to the cross-model weight heatmap on `/models`. Like the existing `WeightsTimeline`, it currently pulls the **entire** weight history for a grid from `/grid/{grid_uuid}/model_weights` and windows/downsamples **client-side**.

Per the original #67 note, a single `(model, metric)` series can run to **tens of thousands of points**, so fetching the whole history doesn't scale for production.

## Ask

Add server-side windowing and/or downsampling to the weight-history endpoint so the FE can request a bounded series:

- time-window params (e.g. `?since=&until=`) to fetch just the slice the slider needs;
- and/or a `max_points` / downsample (LTTB or every-Nth) param for the full-range `WeightsTimeline`.

This is **primarily a backend change** in `smartem-decisions` to `/grid/{grid_uuid}/model_weights`. The FE (`WeightsMatrix` slider + `WeightsTimeline`) then consumes the bounded response instead of windowing client-side — a small follow-on change once the endpoint supports it.

## Not in scope

- The client-side slider itself (shipped in #127). This issue only moves *where* the windowing happens, for production scale.

Refs #67, #127

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.