-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Desiderata
- Copy in Clive's proposal
- Pick the aggday name for this
- Spec or trial implementation
Copied from a forum post by Clive:
I was looking at clocky to measure total sleep time: I'd hoped that if I set my deadline to 14:00, then I could add a datapoint of (say) 22:00 for when I went to bed, add the next datapoint for 06:15 when I get up, and because those are logically on the same day (after the 14:00 deadline), it would faithfully report that I'd slept for 08:15 hours.
Sadly it doesn't work like that at all, it just looks for differences between the datapoints. I'm running a test goal right now, and it's not even clear to me what it's going to do for a pair of datapoints like (22:00, 06:15). They are on different physical days, but it's the same logical Beeminder day as the deadline for the goal is at 14:00, and just skimming the code I'm not sure how that cashes out.
So: can we have a nice time_interval function that actually works as one would expect here, including intervals that cross midnight (if they're on the same logical day)?
Pseudocode is something like:
- for each time, calculate elapsed_time since deadline:
- if time > deadline: elapsed_time = time - deadline
else: elapsed_time = time - deadline + 24
- if time > deadline: elapsed_time = time - deadline
- take pairwise differences of these elapsed_times
Cognata
- https://forum.beeminder.com/t/documentation-of-aggregation-methods-would-be-nice/549/52?u=dreev
- New aggday: square root #272
Verbata: new aggday methods,