-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix issues introduced by the benchmarking mode changes #363
Changes from all commits
ceab982
1371f47
0baa5f2
bb0a2fd
389284e
eaf5844
fb02164
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,7 @@ class DecisionMakerAbciApp(AbciApp[Event]): | |
- done: 4. | ||
- none: 16. | ||
- no majority: 3. | ||
- round timeout: 3. | ||
- new simulated resample: 3. | ||
- benchmarking enabled: 6. | ||
- benchmarking finished: 21. | ||
|
@@ -218,6 +219,7 @@ class DecisionMakerAbciApp(AbciApp[Event]): | |
Event.DONE: SubscriptionRound, | ||
Event.NONE: FinishedWithoutDecisionRound, | ||
Event.NO_MAJORITY: SamplingRound, | ||
Event.ROUND_TIMEOUT: SamplingRound, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was causing an issue in the normal flow. |
||
Event.NEW_SIMULATED_RESAMPLE: SamplingRound, | ||
Event.BENCHMARKING_ENABLED: ToolSelectionRound, | ||
Event.BENCHMARKING_FINISHED: BenchmarkingDoneRound, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ class SamplingRound(UpdateBetsRound): | |
get_name(SynchronizedData.benchmarking_finished), | ||
get_name(SynchronizedData.simulated_day), | ||
) | ||
synchronized_data_class = SynchronizedData | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was causing an issue in the normal flow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still sampling is connected with two different SynchronizedData classes in two different abcis There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you elaborate on that? |
||
|
||
def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: | ||
"""Process the end of the block.""" | ||
|
@@ -57,18 +58,16 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: | |
|
||
synced_data, event = cast(Tuple[SynchronizedData, Enum], res) | ||
|
||
if event != Event.DONE: | ||
return res | ||
|
||
if synced_data.benchmarking_finished: | ||
self.context.logger.info( | ||
"No more markets to bet. The benchmarking has finished!" | ||
) | ||
return synced_data, Event.BENCHMARKING_FINISHED | ||
|
||
if synced_data.simulated_day: | ||
self.context.logger.info( | ||
"Entering the sampling Round for a new simulated day" | ||
) | ||
# re-enter the SamplingRound | ||
return synced_data, Event.NEW_SIMULATED_RESAMPLE | ||
if event == Event.DONE and self.context.benchmarking_mode.enabled: | ||
|
||
if self.context.benchmarking_mode.enabled: | ||
return synced_data, Event.BENCHMARKING_ENABLED | ||
|
||
return res |
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.
This was causing an issue in the normal flow.
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.
Still trying to understand why None is a valid value and False not.
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.
Because otherwise the NONE event cannot ever be emitted from the round.