NatLabRockies / NatLabRockies/H2Integrate
Reorganize Pyomo control rule classes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26
- Forks
- 44
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 16
Description
Reorganize Pyomo control strategy classes
The file h2integrate/control/control_strategies/pyomo_controllers.py has 3 controller strategy classes (and soon more as PR #407 is merged in) with varying level of inheritance that makes it difficult to follow the logic that distinguishes the individual control strategies. I think that the baseclasses should only include methods that are fully used across all controllers that inherit it, without any excess logic that is specific to a single controller.
I also think that the controller baseclass in h2integrate/control/control_strategies/controller_baseclass.py could be removed and be replaced with the PyomoControllerBaseClass.
I almost think it'd be nice to split out these controllers into separate files. Like PyomoControllerBaseConfig and PyomoControllerBaseClass (maybe even SolverOptions if that's used across the Pyomo controllers) could be moved into h2integrate/control/control_strategies/controller_baseclass.py. Then separate files for SimpleBatteryControllerHeuristic, HeuristicLoadFollowingControllerConfig and HeuristicLoadFollowingController, and OptimizedDispatchControllerConfig and OptimizedDispatchController.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading h2integrate/control/control_strategies/pyomo_controllers.py and controller_baseclass.py, then compare the three controller strategy classes and their shared methods. Review the proposed PyomoControllerBaseConfig, PyomoControllerBaseClass, and SolverOptions organization, including the controllers named in the issue. Done means the inheritance and file layout clearly separate shared logic from controller-specific behavior without changing strategy behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100