Skip to content
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

Continuity of Shift-By #790

Open
jordanrfrazier opened this issue Oct 4, 2023 · 1 comment
Open

Continuity of Shift-By #790

jordanrfrazier opened this issue Oct 4, 2023 · 1 comment

Comments

@jordanrfrazier
Copy link
Collaborator

jordanrfrazier commented Oct 4, 2023

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
@bjchambers
Copy link
Collaborator

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants