fix: move derived actuator constants to calculated properties instead… - #489
Conversation
… of redundant hard-coded vals
| @MOTOR_CONSTANTS.setter | ||
| def MOTOR_CONSTANTS(self, value: MOTOR_CONSTANTS) -> None: | ||
| """ |
There was a problem hiding this comment.
Requires validation for the incoming MOTOR_CONSTANTS data class value
senthurayyappan
left a comment
There was a problem hiding this comment.
Looks great! The MOTOR_CONSTANTS setter requires some validation to preserve the structure/attributes of the initial MOTOR_CONSTANTS dataclass, as it is possible to miss an attribute and overwrite it.
misc: add unit tests for dephy actuator
|
Done - I also added some unit tests to make sure the validation worked, as well as the constants calculation. Fixed a copilot bug too. |
…not-propagate-to-other-constants-in-dephypy
|
@senthurayyappan great, I pulled in the latest |
|
@senthurayyappan I found an issue with how I did this. The setter method is only called when assigning entirely new motor_constants objects. If you try to just write to one of them like |
… of redundant hard-coded vals.
This PR fixes #487.