Skip to content

Pass attribute instead of datatype into _get_read_widget#321

Open
jacob720 wants to merge 1 commit intomainfrom
pass_attribute_into_get_read_widget
Open

Pass attribute instead of datatype into _get_read_widget#321
jacob720 wants to merge 1 commit intomainfrom
pass_attribute_into_get_read_widget

Conversation

@jacob720
Copy link

@jacob720 jacob720 commented Feb 13, 2026

Fixes #298

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error messages for waveform constraint violations with additional attribute details.
  • Improvements

    • Updated widget handling for table attributes and improved data type processing.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

Both EPICS GUI transport files refactor _get_read_widget method signature to accept Attribute objects instead of DataType parameters. This enables access to the full attribute context for improved error reporting, particularly for waveform validation. The PVA GUI file additionally updates widget construction logic and the _get_write_widget method to handle the new Attribute-based approach.

Changes

Cohort / File(s) Summary
EPICS CA GUI
src/fastcs/transports/epics/gui.py
Refactored _get_read_widget to accept Attribute instead of DataType. Enhanced 1D waveform violation warning to include attribute and shape information. Updated call sites in _get_attribute_component to pass full Attribute object.
EPICS PVA GUI
src/fastcs/transports/epics/pva/gui.py
Added imports for AttrR and Attribute. Refactored _get_read_widget signature to accept Attribute, with Table read path using attribute.datatype and wrapping widgets with AttrR(). Updated _get_write_widget to handle Table types via attribute.structured_dtype with special CheckBox handling for Bool fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A widget refactor, neat and bright,
With Attributes now shining in the light,
Error messages bloom with detail so grand,
The PVA and CA, paw-in-paw, hand-in-hand,
From DataTypes past, we've made our flight! ✨

🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (4 files):

⚔️ src/fastcs/transports/epics/ca/ioc.py (content)
⚔️ src/fastcs/transports/epics/gui.py (content)
⚔️ src/fastcs/transports/epics/pva/gui.py (content)
⚔️ tests/transports/epics/ca/test_softioc.py (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the primary change: passing Attribute instead of DataType into _get_read_widget method.
Linked Issues check ✅ Passed The PR fulfills the main objective from issue #298: passing Attribute to _get_read_widget and updating exception handling for 2D waveforms to include attribute information.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of passing Attribute instead of DataType into _get_read_widget, with appropriate cascading updates to method signatures and logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pass_attribute_into_get_read_widget
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch pass_attribute_into_get_read_widget
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.84%. Comparing base (9967981) to head (98ddf4f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   90.82%   90.84%   +0.02%     
==========================================
  Files          70       70              
  Lines        2551     2557       +6     
==========================================
+ Hits         2317     2323       +6     
  Misses        234      234              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Pass Attribute to _get_read_widget instead of DataType

1 participant