Skip to content
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

HWP Supervisor type checking and refactoring #749

Open
jlashner opened this issue Sep 6, 2024 · 0 comments
Open

HWP Supervisor type checking and refactoring #749

jlashner opened this issue Sep 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jlashner
Copy link
Collaborator

jlashner commented Sep 6, 2024

The HWP supervisor agent has grown a lot since its initial release do to features required for field usage, and has become difficult to navigate.

I think it would benefit a lot from a focused refactoring to clean up its structure, and add proper type hints for more complete static type checking. If I were to do such a refactor, I'd want to do the following...

  • Use a dedicated configuration object to control parameters such as instance ids and pid_max_time_since_last_update. Currently I've just thrown many of these into the HWP state object because that is accessible from many different parts of the code, but this should be put into a dedicated cfg class.
    • I would also want to switch from using command line arguments to a yaml file, since the number of arguments has grown to ~30 which is a bit unwieldy.
  • Move the HWP state and the control state-machine functionality to separate modules, for better delineation between their logic.
  • Complete static type checking. This may require some small structural changes, but because the module is so large and difficult to test I think this would be invaluable.
@BrianJKoopman BrianJKoopman added the enhancement New feature or request label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants