Refactor buffer retrieval methods in BPM, LBLM, PMT, and Wire classes - #31
Merged
Conversation
…er.get_data_buffer() in BPM, LBLM, PMT, and Wire classes
There was a problem hiding this comment.
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
*_bufferhelper methods to accept**kwargsand forward them tobuffer.get(...). - Updated
BPMCollection.get_buffer_data(...)to accept**kwargsand pass them through tobuffer.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.
… to use type hints and simplify error handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_buffermethod with the more generalgetmethod, 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, andWiredevice classes to usebuffer.get()instead ofbuffer.get_data_buffer(), and added**kwargsto support additional parameters. This change standardizes buffer access and increases method flexibility.Modified the
get_buffer_datamethod in theBPMcollection to accept**kwargsand pass them tobuffer.get(), allowing for more customizable buffer queries.These changes make the device classes more consistent and extensible when interacting with timing buffers.