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

Suggested addition to rollup callendar intervals #179

Open
local-minimum opened this issue Feb 1, 2020 · 0 comments
Open

Suggested addition to rollup callendar intervals #179

local-minimum opened this issue Feb 1, 2020 · 0 comments

Comments

@local-minimum
Copy link

Pond.js has some fantastic ease of use TimeSeries roll-up functions, but it does have support for iso standard weeks (Monday - Sunday), nor it seems the US/Canada non-standard Sunday-Saturday is supported.

From what I've gleaned the most proximate possibility is

const ts = new TimeSeries(data);
const weekly = ts.fixedWindowRollup({ windowSize: '7d', aggregation: { in: { in: sum() } } });

But as the unix epoch wasn't on a Monday, nor Sunday for that matter, this splits the data in the middle of the week.

Suggested interface

Using fixedWindowRollup for Monday - Sunday:

const ts = new TimeSeries(data);
const weekly = ts.fixedWindowRollup({ windowSize: 'weekly', aggregation: { in: { in: sum() } } });

Using fixedWindowRollup for Sunday - Saturday, if such support should be included:

const ts = new TimeSeries(data);
const weekly = ts.fixedWindowRollup({ windowSize: 'weekly-1', aggregation: { in: { in: sum() } } });

If non-standard Sunday - Saturday needs to be included, then probably all offsets should be as there's a variety of non-standard first days of the week around the world.

If a weeklyRollup method should be included, it's a bit unclear what the interface ought to be, but perhaps only a support of iso-weeks with TimeSeries.weeklyRollup(options)

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

No branches or pull requests

2 participants