Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #135 +/- ##
==========================================
- Coverage 90.83% 90.81% -0.03%
==========================================
Files 41 41
Lines 1954 1971 +17
==========================================
+ Hits 1775 1790 +15
- Misses 179 181 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Could be helpful for setting up things like converters so we can have less logic inside the update/put calls! |
There was a problem hiding this comment.
I think as part of this change we should take out controller as an argument to put/update, making this PR unneccesary.
If the user wants the controller in the handler for use in put or update then they should store it as an attribute (in the python sense) in their handler from initialise.
We can take out controller as an argument here
Lines 76 to 87 in 5aa7a12
and here
Lines 130 to 141 in 5aa7a12
66d4dc7 to
8005664
Compare
…Added initialise method to Attribute, checks for handler and calls the method. Moved initialise into BaseController class, loops over attributes calling initialise with a reference to self. Added unit test for Attribute class.
…ated initialisation.
…lank initialise method.
6da6ec6 to
e7430a5
Compare
|
This is actually broken and is showing up a lack of testing. The updater callbacks are still being called with a controller here, which causes them to stop and print a warning. The reason this exception is caught and printed was originally so that one attribute update failing doesn't crash the whole application. I was on the fence about this and am again thinking just crashing would be better. Although to be fair if this had type hints that would have caught it. |
|
Good spot, I guess you noticed this by running an application? Perhaps I should add the type hints as this is not really a runtime exception but a develop time syntax error. |
2921205 to
d52f300
Compare
Resolves #59
Added default initialise methods to Sender and Updater base classes.
Added initialise method to Attribute, checks for handler and calls the method.
Moved initialise into BaseController class, loops over attributes calling initialise with a reference to self.
Added unit test for Attribute class.
Fixes #59
Fixes #130