-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor ExecutionSegment sequences, wrappers and tuples #1446
Conversation
hmm not sure why this linter issue doesn't show locally 😕 I'll force-push... |
This cleans up the interfaces and makes it possible to re-use the heavy calculations for a segment sequence.
Codecov Report
@@ Coverage Diff @@
## new-schedulers #1446 +/- ##
==================================================
- Coverage 76.34% 76.31% -0.03%
==================================================
Files 162 162
Lines 12936 12937 +1
==================================================
- Hits 9876 9873 -3
- Misses 2545 2550 +5
+ Partials 515 514 -1
Continue to review full report at Codecov.
|
// NewExecutionTuple returns a new ExecutionTuple for the provided segment and | ||
// sequence. | ||
// | ||
// TODO: don't return a pointer? |
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 Pointer was required because fillCached needed to change the tuple so ... now this can be a not pointer :D
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.
yeah, and I started doing it, but then I had to change like a 1000 uses... I don't mind doing it now, but if I had done it, I imagined you would have said (not incorrectly) something like "this could have been done later" 😉
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 probably would - I remember moving from the non-pointer to the pointer variant and it took half an afternoon :). To be honest I don't think this is worth an issue, and it's likely won't better anything if changed at this point. I just wanted to point (pun intented :P) out why this was the case :D
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.
LGTM!
I do think now, that we have used it somewhat throughout the code, we can do a lot of those changes and I like the new API somewhat better than the old. Especially the whole no need to provide the segment the whole time.
prev[index] = iteration | ||
if int64(len(offsets[index])) == numerator { | ||
offsets[index] = append(offsets[index], offsets[index][0]+lcd-iteration) | ||
} |
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 like that this lambda is not external anymore, and the algorithm is in a single place now. 👍
This cleans up the interfaces and makes it possible to re-use the heavy calculations for a segment sequence.
closes #1379