simonsobs / simonsobs/socs

HWP Supervisor type checking and refactoring

Open
#749 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
17
Forks
20
Avg merge
1h 22m
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the HWP supervisor agent and reading its current state, command-line configuration, and control state-machine entry points. The refactor would be complete when configuration is dedicated and YAML-based, state and control logic are separated, and the supervisor passes comprehensive static type checking.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.