krr
krr copied to clipboard
Refactoring concept: generate typer commands from config
Related to #219
This is a proposal to move typer command generation to a separate file, restructure components in functions so it is easier to understand what is going on, and to use Pydantic's field extra params to generate typer commands from Config.
Pros:
- Now to add a new flag it is only required to add it to config
- Was able to refactor the way a strategy is created, so now it is the same mechanism with strategy settings, so it is easier to understand
- Code is easier to read for newcomers (it is easier to understand how commands are generated)
- Data validation and setup of how it is described in
--helpis now in the same place, and that is much more convenient
Cons:
- We still use inspect in runtime
NOTE: This is not yet finished, but rather an idea on the change
@aantn WDYT?