-
Notifications
You must be signed in to change notification settings - Fork 25
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
[SW eng] Proposal: Abstract common patterns between predictoor/trader into base_agent #319
Comments
We should avoid heavy inheritance chains. They are extremely hard to maintain, because to understand a given class you need to also understand all the details of its parent clasess. Much better is composability: have well-defined classes / objects that can be used as attributes by client agents. These client agents only need to interact with the interface of the composable agents. I had thought about having a BaseAgent. But I explicitly chose not to, because it would become a unwieldy inheritance chain: BaseAgent <- BasePredictoorAgent <- PredictoorAgent3; and BaseAgent <- [Base]TraderAgent <- TraderAgent1. 3 levels of inheritance hierachy? Yuck. Instead, I explicitly went the composability route
So please, let's not do this. If you would like to revise this proposal without inheritance, go for it. But if any fancier inheritance remains, I will push back. |
Hi @trentmc, thanks for providing more insight/perspectives. I thought that might be the case and I generally agree, I'm just worried about the amount of duplication that's taking place and how certain functionality is fragmenting. Example: Now part of traderAgents are logging while predictoors are printing. take_step, _process_block, cache fns, and various other fns are nearly 1:1 across all agents. Traders can take action async, while predictoor core functions are synchronous. As an additional note, due to some of our CICD tools (i.e. pylint rules), the agentN classes are growing in a way that breaks various linter rules and forces us to silence lint rather than "clean up". I believe this is making it harder to maintain the code base especially when working broadly and deeply across flows. Maybe we can leave this here and see how the agent permutations evolve before revisiting. |
Let's revisit after I get farther down #278 |
take_step is specific to each agent. There is nothing to share. Same with _process_block. Same with _cache functions. If there is stuff that could be shared between predictoor and trader agents, we should do it as via composability (or via a mixin). I'm closing this issue. |
NOTE: do not build this until we have agreement. Currently, we don't.
Problem
_process_block_at_feed
are starting to divergeDoD
The text was updated successfully, but these errors were encountered: