Continuity of Shift-By
Summary
Discussing the continuity of shift-by: whether it should be continuous or discrete, or whether the argument to the shift-by can influence the continuity.
Current Behavior
Shift-by is always discrete, as it is currently implemented by shift-to, which always produces discrete values
shift_by(value) => shift_to(add_time(delta, time_of(value)), value)
Desired Behavior
Tentatively, we would think that shifting a continuous value by a fixed time would produce continuous values. So, something like the following would stay continuous.
Foo.shift_by(5 minutes)
However, shift_by can also shift rows to a single time, or re-order rows, in the same manner that shift_to can. This would lean towards producing discrete values, following that behavior, but I would lean towards not having different interpolations for shift_by values.
Foo.shift_by(Foo.time) # where Foo.time is a variable time
Ah. The fixed vs. variable time is an important distinction. While it may be reasonable to say "shifting by a fixed time preserves continuity, shifting by a dynamic time goes back to discrete values" this would be the first time that the continuity of a function depended on both the continuity of it's inputs and whether they were literal or not. In fact, we don't have anywhere else where continuity depends on whether a value is constant. This feels like it would need more thought before we made that case continuous.
I guess the "work around" if you need continuity is always Foo.shift_by(5 minutes).last() or something like that, which isn't horrible...