Numeric initial value no longer hardcoded to 0 - #415
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesNumeric initial value selection
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/transports/epics/pva/test_p4p.py (1)
229-232: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the
AttrWtest distinguish the fallback source.
AttrW(Int())expects0, so the test also passes if the implementation uses a hard-coded0. Use a datatype fixture with a non-zeroinitial_valueand assert that value.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/transports/epics/pva/test_p4p.py` around lines 229 - 232, Update test_attr_w_shared_write_pv_uses_datatype_initial_value to construct AttrW with a datatype fixture whose initial_value is non-zero, then assert shared_pv.current()["value"] matches that value instead of hard-coded zero. Keep the test focused on verifying the datatype-provided initial value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/transports/epics/pva/test_p4p.py`:
- Around line 229-232: Update
test_attr_w_shared_write_pv_uses_datatype_initial_value to construct AttrW with
a datatype fixture whose initial_value is non-zero, then assert
shared_pv.current()["value"] matches that value instead of hard-coded zero. Keep
the test focused on verifying the datatype-provided initial value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b1b6c2f7-3ed9-4a08-af70-5e5cd8bd99b8
📒 Files selected for processing (2)
src/fastcs/transports/epics/pva/_pv_handlers.pytests/transports/epics/pva/test_p4p.py
New logic for initial value on numeric datatypes. Not obvious to me what the initial value should with a given set of upper and lower bounds, this seemed sensible-ish to me. Depending on the bounds specified, initial val is either set to the min, 0, or the max
Fixes #414
Summary by CodeRabbit
Bug Fixes
Tests