feat(device): simplify device info structure by removing redundant keys#1007
Open
wakonig wants to merge 2 commits into
Open
feat(device): simplify device info structure by removing redundant keys#1007wakonig wants to merge 2 commits into
wakonig wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR flattens the device info payload structure by removing the redundant device_info wrapper key (and associated nested access patterns), updating both server-side serialization and client/test expectations accordingly.
Changes:
- Flatten
get_device_info()output in the device server serializer (remove thedevice_infowrapper). - Update
DeviceBase/DeviceManagerand multiple test fixtures to consume the flattened info structure. - Adjust tests and mocks that construct/inspect device info dicts (signals, ownership mode, hints, sub-devices).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bec_server/tests/tests_device_server/test_device_serializer.py | Updates assertions to read flattened keys (e.g., info["signals"], info["ownership_mode"]). |
| bec_server/bec_server/scan_server/tests/scan_fixtures.py | Updates scan test fixtures to pass flattened device info into DeviceBase. |
| bec_server/bec_server/device_server/devices/device_serializer.py | Flattens the get_device_info() return structure by removing device_info nesting. |
| bec_lib/tests/test_dap_plugins.py | Updates mocked DeviceBase(info=...) construction to match flattened info format. |
| bec_lib/bec_lib/tests/utils.py | Updates multiple device-info mocks/messages to the flattened structure. |
| bec_lib/bec_lib/devicemanager.py | Updates device manager parsing/instantiation to read top-level info keys. |
| bec_lib/bec_lib/device.py | Updates DeviceBase to store the entire info dict directly and parse flattened sub-device/custom-access shapes. |
Comments suppressed due to low confidence (1)
bec_lib/bec_lib/tests/utils.py:419
- There should be two blank lines between the end of the
# fmt: off/onblock and the next top-level function definition to satisfy Black/PEP8; otherwise the formatter check may fail.
# fmt: on
def get_device_info_mock(device_name, device_class) -> messages.DeviceInfoMessage:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
wakonig
marked this pull request as ready for review
July 23, 2026 08:49
wakonig
force-pushed
the
feature/simplify_device_info
branch
from
July 23, 2026 08:53
7c8db5e to
2ff613c
Compare
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.
Description
This PR simplifies the device info: https://github.com/bec-project/bec/pull/1007/changes#diff-48a79e17403712240993cc8b6d62287987743c8c3f9c064dbd858f64b491aea4L311
The device name is already part of the device info message so we don't need to add it to the info as well. With the device name gone, there is no need for a nesting.
Additional Comments
This should allow us to write a proper device info api more cleanly.
We need to update some tests in BW though.
Definition of Done