Skip to content

Review caching in spectrum viewer #2839

@ashleymeigh2

Description

@ashleymeigh2

Current Behaviour

SpectrumViewerWindowPresenter calls model.get_spectrum in multiple places without consistently using caching. Moving an ROI back and forth with the spin boxes triggers full recalculation instead of reusing cached results. Refactoring is needed to ensure caching and incremental updates are applied across all paths.

Desired Behaviour

Ensure all presenter paths consistently use model.store_spectrum() so cached spectra are reused, chunking fills only missing frames.

Potential Pitfalls or Risks to Avoid

  • Cache key mismatches (must include roi, open_beam_roi, mode, shuttercount flag).

  • Half-updated spectra if chunk cancellation is mishandled.

Importance of Feature

  • Cuts redundant computation on ROI nudging → faster, smoother UI.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Impeded

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions