Refactor _BatchManager
to have list of batches per step
#353
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.
Description
The current implementation of
_BatchManager
was very limited, as it only allowed to have one batch per step. This implementation was not realistic as some steps are faster than others.For example,
step3
depends onstep2
andstep1
.step1
is faster thanstep2
and is able to generate 2 batches faster thanstep2
to generate one. As one batch was already added to_BatchManager
forstep1
, when the second is going to be added the current implementation would raise aValueError
as there is a batch fromstep1
already waiting forstep2
.This PR modifies the
_BatchManager
, so it has a list of batches per step. In addition, the attributeseq_no
has been added to_Batch
, to be able to sync the input batches for a step.