Skip to content

fix: restore live HKL calculation, throttle updates, and drop repeated log errors - #176

Open
Osayi-ANL wants to merge 3 commits into
mainfrom
fix/hkl-calculation-throttle
Open

Osayi-ANL wants to merge 3 commits into
mainfrom
fix/hkl-calculation-throttle

Conversation

@Osayi-ANL

@Osayi-ANL Osayi-ANL commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Live HKL calculation works again. Each profile's explicit HKL.SPEC energy and UB channels now win over the generated defaults, so SPEC and Bluesky configurations use their own PVs, and hkl_setup no longer requests the removed motor name fields that stopped geometry setup. A NaN motor position PV now fails setup with a logged error naming the PV, instead of silently turning every H, K, L value into NaN.

HKL updates are throttled to PREVIEW['HKL_UPDATE_INTERVAL_MS'] (500 ms) instead of a fixed 100 ms.

The HKL calculation reruns on every HKL PV change, so one failure would write the same error to the log thousands of times. LogManager now takes repeat_window (keyword, default 60 s) and get_logger(..., drop_repeats=True) writes a repeated message once per window. BaseWindow viewers opt in with log_drop_repeats; the Area Detector does, and its HKL messages go through its logger instead of print().

Commits

  1. fix: restore live HKL calculation
  2. fix: throttle live HKL updates
  3. add: LogManager repeat filter

Validation

pytest tests/unit (872 passed, each commit passes on its own), ruff check src/dashpva/

@Osayi-ANL
Osayi-ANL force-pushed the fix/hkl-calculation-throttle branch 5 times, most recently from e59117c to e6ca6ac Compare September 29, 2026 22:13
@Osayi-ANL
Osayi-ANL force-pushed the fix/hkl-calculation-throttle branch from e6ca6ac to 3028d33 Compare October 9, 2026 19:45
@Osayi-ANL Osayi-ANL changed the title fix: restore live HKL calculation and throttle updates fix: restore live HKL calculation, throttle updates, and drop repeated log errors Oct 9, 2026
…els win over generated defaults, hkl_setup no longer requests the removed motor-name fields, and a NaN motor position fails setup with a logged error instead of silently giving NaN HKL
… so one failure would write the same error to the log thousands of times; with drop_repeats a repeated message is written once per repeat_window (default 60 s)

change: area detector HKL messages go through its logger with drop_repeats instead of print()
@Osayi-ANL
Osayi-ANL force-pushed the fix/hkl-calculation-throttle branch from 3028d33 to 3c8a636 Compare October 9, 2026 20:18
@Osayi-ANL
Osayi-ANL marked this pull request as ready for review October 9, 2026 20:23
@Osayi-ANL
Osayi-ANL requested a review from pecomyint October 9, 2026 20:23
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