Add more granular intervals (replace 'days' with generic 'ticks')#245
Conversation
Signed-off-by: Robert Lin <robertlin1@gmail.com>
|
awkward, really messed up following the DCO bot's suggestion... squashed everything into a single commit and force-pushed 😅 |
Signed-off-by: Robert Lin <robertlin1@gmail.com>
|
@vmarkovtsev , which version of protoc and protoc-gen-go do you use? When I build the proto files I seem to get pretty significant diffs. libprotoc 3.6.1 |
Signed-off-by: Robert Lin <robertlin1@gmail.com>
|
a few comments on the currently failing tests:
on my machine, I get |
vmarkovtsev
left a comment
There was a problem hiding this comment.
This was a huge amount of work 👍 ! Nothing breaking in the review comments.
| ticks.tickSize = time.Duration(val) * time.Hour | ||
| } else { | ||
| // default to 1 day | ||
| ticks.tickSize = 24 * time.Hour |
There was a problem hiding this comment.
We should check if tickSize is 0 inside Initialize() and set it to the default if it is. If there wasn't ConfigTicksSinceStartTickSize, we should change the current value to the default only if it equals to 0.
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
|
@vmarkovtsev I realized in all this I missed actually incorporating the ticksize into the burndown analysis 😅 so I just had a shot at it in 77cf86a - is there a test I didn't update that I should update / write to verify that this behaves properly for various Also wondering if you saw my other comment re: my protobuf generation being significantly different from yours, in this comment: #245 (comment), and the failing tests in #245 (comment) |
|
Regarding Regarding 1969 vs 1970, the difference is due to the timezones. I cannot advise what exactly should be changed, but it is definitely because the European timezone is mishandled. Regarding testing |
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Yep, I can generate it correctly using the Makefile - but I think there's either a bit of a version mismatch, or I am doing something wrong. I have Just a thought, but with generated code I usually add a CI job to generate code using the expected version of the tools, and then use
Is the expected behaviour for merging different tick sizes to error? It currently doesn't, because I added this: if bar1.TickSize < bar2.TickSize {
merged.TickSize = bar1.TickSize
} else {
merged.TickSize = bar2.TickSize
} |
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
|
Different tick sizes do not contradict with result merging, but they add complexity to the code which is already complex as hell. We cannot just set the tick size because we need to resample the matrices, and that's not short. So if the tick sizes are different, we should return an error for now. |
|
I installed |
Probably best to leave this for another PR, if that's okay - we'll want to bump protobuf dependencies, and a bit of scripting will be needed as well (since |
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
…ences Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
Signed-off-by: Robert Lin <robertlin1@gmail.com>
| assert.Equal(t, res[DependencyTick].(int), 0) | ||
| assert.Equal(t, tss.previousTick, 0) | ||
| assert.Equal(t, tss.tick0.Year(), 1969) | ||
| if (tss.tick0.Year() != 1969) && (tss.tick0.Year() != 1970) { |
There was a problem hiding this comment.
The root of the problems seems to be that commit.Committer.When is initialized to time.Unix(0, 0) and that time must be GMT. It is subsequently converted to the local time and we get 1969. Should be fine here.
|
Pending tasks:
I can take care of (2) if you wish. |
Signed-off-by: Robert Lin <robertlin1@gmail.com>
thanks for the reviews and help @vmarkovtsev ! |
Add more granular intervals (replace 'days' with generic 'ticks')
Add more granular intervals (replace 'days' with generic 'ticks')

closes #238 , more context is in the issue
Seeking feedback! 🙏 probably still needs a bit of work
this PR changes all mentions of "days" to more flexible "ticks", currently configured by
ConfigTicksSinceStartTicksSize(or--tick-size) that accepts an integer value as the number of hours, though tick size is actually tracked astime.Durationso even more granular options could be exposed (though likely doesn't need to)internal/plumbing/day.gowas renamed toticks.gowhich unfortunately makes the diff a bit hard to review, sorry!default tick size
sets to 24 hours as before, so hopefully it's not significantly breaking
custom tick size
for example, with 1 hour:
bugs
any pointers on these would be appreciated!
laboursto work, but I havent investigated it yet:edit works with
hercules --burndown --first-parent --tick-size=1 --pb https://github.com/bobheadxi/calories | python3 labours.py -f pb -m burndown-project, I think it's an issue with small repos. that said, the timescales dont work properly with anything other than--tick-size=24for now.