Change surplus based tests to use new data from orderbook #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #90 for the competition surplus test and combinatorial auction test.
The main changes are:
Before, information on trades (order data and order execution) were read from calldata. For non-winning solutions this is not possible anymore. For the winning solution it is still possible. But due to changes to the ordering of orders in the competition data, it was not easy for me to reconstruct the link from uid to trade. Thus, all information is not obtained through the orderbook api.
In principle, information on fees for non-winning solutions could be computed from clearing prices in combination with effective buy and sell amount. This is not done here since fees do not matter for surplus. Also clearing prices are not yet part of the data in the competition endpoint.
Information on costs for non-winning solutions is and will not available. A test of the form
fees >= costs
had to be removed due to that.The old code had a "bug" where only one execution per solver was studied. This is fixed now and the test should work correctly with solvers submitting multiple solutions. The fix required changing the data format for alternative solutions from a
dict
to alist