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

Replacing the current value in a series corrupts aggregate values #36

Open
karanlyons opened this issue Jun 7, 2018 · 0 comments
Open

Comments

@karanlyons
Copy link
Contributor

> ts.create root 100
> ts.create test 100
> ts.createrule root sum 10 test
> ts.range root 0 100
(empty list or set)
> ts.range test 0 100
(empty list or set)
> ts.add root 10 1
> ts.range root 0 100
1) 1) (integer) 10
   2) "1”
> ts.range test 0 100
1) 1) (integer) 10
   2) "1"
> ts.add root 10 5
> ts.range root 0 100
1) 1) (integer) 10
   2) "5"
> ts.range test 0 100
1) 1) (integer) 10
   2) "6"

We need to store the last calculated value in aggregate contexts and then either add a replaceValue method that works off of the last calculated value as opposed to the current one, or pass timestamp to appendValue and add a branch to do what replaceValue would do.

For backwards compatibility and code style reasons I’d prefer—I think—to add replaceValue, and I’ll submit a pull doing so.

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

1 participant