-
Notifications
You must be signed in to change notification settings - Fork 15
Removes subclassing for ControlStates #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I just tested this bug fix with the satp1 hwp. I needed to rename every instance of |
|
I'm a bit confused, where did you need to rename |
|
Specifically lines 620, 621, 634, 715, and 716 (basically I just reverted the changes that were made to rename |
|
Ah ok, yes I did miss those return statements. I changed |
|
@bbixler500 if you could re-test this next time you have the chance that would be great. Thanks for catching that! |
|
Just tested the fix on satp1 and everything ran without issue (so long as I used docker images that had older definitions of main/acq) |
Does this mean we still need #657 wrapped up for newer images to work? |
Yes, but only the portions which change the naming of 'acq' to 'main' |
|
I can add those changes to this PR. |
|
Are we currently waiting on anything for this? Do we need to test again with the latest commit, or are we just waiting for an approval from @BrianJKoopman? |
|
I think we just waiting for approval. I tested the most recent changes without issue |
BrianJKoopman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just one docstring change needed.
| session.status = 'stopping' | ||
| return True, 'Stopping monitor process' | ||
|
|
||
| @ocs_agent.param('test_mode', type=bool, default=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add arg to docstring.
BrianJKoopman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Bugfixes that are related to subclassing dataclasses
Description
This fixes the same problem that @bbixler500 addresses in #657, however does it by replacing the inheritance of the
Baseclass with the addition of aControlStateInfoclass that manages general state metadata such as start and last update time, and the state-name.Motivation and Context
This fixes issues in the current code where having a dataclass subclass a non-dataclass object will overwrite the init function, leaving fields undefined.
I think Bryce's method of using
kw_only=Trueis a valid fix, but only works python >=3.10.Since the mechanics of combining dataclasses and inheritance is not fully clear to me, I think its generally better to use this method even after python3.10, since the inheritance is more prone to error.
How Has This Been Tested?
I added a hwp-supervisor unit test that exposes the existing bug, and it is passes with the new code. If @bbixler500 or @ykyohei could test on one of the sat platforms that would be ideal though.
Types of changes
Checklist: