Skip to content

Refactor buffer retrieval methods in BPM, LBLM, PMT, and Wire classes - #31

Merged
kabanaty merged 4 commits into
slaclab:mainfrom
kabanaty:size-check
Jun 2, 2026
Merged

Refactor buffer retrieval methods in BPM, LBLM, PMT, and Wire classes#31
kabanaty merged 4 commits into
slaclab:mainfrom
kabanaty:size-check

Conversation

@kabanaty

@kabanaty kabanaty commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors several device classes to standardize and modernize the way buffer data is retrieved. The main change is replacing calls to a custom get_data_buffer method with the more general get method, while also allowing additional keyword arguments to be passed through. This improves flexibility and consistency across device classes.

Buffer access refactoring:

  • Updated all buffer data retrieval methods in BPM, LBLM, PMT, and Wire device classes to use buffer.get() instead of buffer.get_data_buffer(), and added **kwargs to support additional parameters. This change standardizes buffer access and increases method flexibility.

  • Modified the get_buffer_data method in the BPM collection to accept **kwargs and pass them to buffer.get(), allowing for more customizable buffer queries.

These changes make the device classes more consistent and extensible when interacting with timing buffers.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors timing-buffer retrieval helpers across several device classes (BPM, LBLM, PMT, Wire) to make buffer access more flexible by forwarding additional parameters into buffer.get(...).

Changes:

  • Updated per-device *_buffer helper methods to accept **kwargs and forward them to buffer.get(...).
  • Updated BPMCollection.get_buffer_data(...) to accept **kwargs and pass them through to buffer.get(...).
  • Introduced new “raise on None” behavior in several buffer helpers (BPM/LBLM/PMT), changing their contracts compared to the prior “return raw result” behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
slac_devices/wire.py Updates wire position buffer retrieval to forward **kwargs into buffer.get(...).
slac_devices/pmt.py Updates PMT QDCRAW buffer retrieval to forward **kwargs (and adds new error-on-None behavior).
slac_devices/lblm.py Updates LBLM buffer retrieval helpers to forward **kwargs (and adds new error-on-None behavior).
slac_devices/bpm.py Updates BPM buffer retrieval helpers and collection retrieval to forward **kwargs (and adds new error-on-None behavior + updated exception handling).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread slac_devices/wire.py Outdated
Comment thread slac_devices/pmt.py Outdated
Comment thread slac_devices/lblm.py Outdated
Comment thread slac_devices/lblm.py Outdated
Comment thread slac_devices/lblm.py Outdated
Comment thread slac_devices/bpm.py Outdated
Comment thread slac_devices/bpm.py Outdated
Comment thread slac_devices/bpm.py Outdated
Comment thread slac_devices/bpm.py
… to use type hints and simplify error handling

@eloise-nebula eloise-nebula left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kabanaty
kabanaty merged commit c85c7f6 into slaclab:main Jun 2, 2026
3 checks passed
@kabanaty
kabanaty deleted the size-check branch July 27, 2026 17:10
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.

3 participants