-
Notifications
You must be signed in to change notification settings - Fork 83
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
Move settlements merging into SingleOrderSolver #434
Conversation
@@ -1,4 +1,5 @@ | |||
use crate::{ | |||
driver::solver_settlements::merge_settlements, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this function to something like mod single_order_solver::merge
?
Fine where it is as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The single order solver currently doesn't live in its own directory. If I'm not mistaken we would have to either create that directory structure (making git blame less effective) or let the merge file float around in the /solver
directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine either way, just thought I should ask (because where the code was used moved drastically, I thought it might make sense to move the code). No strong opinions though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely is a valid point.
I believe when we are eventually happy with the new driver we probably should move around a bunch of code from the old driver and solver crates so maybe that would be a good time to do it.
I will merge for now and keep that in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change!
I see your point that we shouldn't change trait Solver
to return a single Settlement
instead of a Vec<Settlement>
because the simulation happens in the driver run loop.
Codecov Report
@@ Coverage Diff @@
## main #434 +/- ##
==========================================
+ Coverage 63.58% 63.97% +0.38%
==========================================
Files 228 228
Lines 44572 44266 -306
==========================================
- Hits 28343 28317 -26
+ Misses 16229 15949 -280 |
Merging multiple single order settlements in the driver is a bit awkward. Instead it should be the responsibility of the
SingleOrderSolver
because those solvers are the only ones that need merged settlements anyway.To make it a bit nicer to create
SingleOrderSolver
s generically (and more inline with what we do for price estimators) I also made it use dynamic dispatch instead of static dispatch.Initially discussed here
Test Plan
Only moved logic around => CI
updated test asserting the number of generated settlements