Improve Controller Attribute and sub controller creation with __setattr__#235
Merged
Improve Controller Attribute and sub controller creation with __setattr__#235
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #235 +/- ##
==========================================
+ Coverage 90.15% 90.18% +0.02%
==========================================
Files 44 45 +1
Lines 2256 2273 +17
==========================================
+ Hits 2034 2050 +16
- Misses 222 223 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dfc9be9 to
1b23440
Compare
1b23440 to
46deaa7
Compare
coretl
approved these changes
Oct 22, 2025
Contributor
coretl
left a comment
There was a problem hiding this comment.
From a skim this looks fine
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.
Breaking Changes
register_sub_controller->add_sub_controllerregister_sub_controllerwith a PascalCase name, you can instead add it as an attribute with a snake_case name and the generated PVs will be the same.Features
Controller.add_attributethat can be used instead ofsetattr(self, ...)- direct access toController.attributesmay be deprecated in a future releaseadd_sub_controllercan be used directly if adding programmatically or to avoid using a non-snake-case name for an attribute. They will be available viacontroller.<sub_controller_name>in the interactive shell either wayAttributesare added to a controller, the name used is added to its_namefield to use in__repr__so you can tell what they are in log statements and the debugger