-
Notifications
You must be signed in to change notification settings - Fork 20
Update MovingWindow to add resampler #272
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
Update MovingWindow to add resampler #272
Conversation
|
This is a draft which only updates the size parameter type to timedelta of the MovingWindow at the moment. |
cca7aa2 to
8ac2f18
Compare
matthias-wende-frequenz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking quite good already. I'll have another look once the commit title doesn't say dirty any more :).
Cool, good to know that! Then it will 'beautify' the current changes and add units tests. I'll let you know once it's ready to review |
6cdf005 to
13cf9a2
Compare
13cf9a2 to
96aa37f
Compare
d872415 to
32f4f52
Compare
|
Rebased onto latest v0.x.x branch |
matthias-wende-frequenz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one last comment :)
| documentation. | ||
| Resampling might be required to reduce the number of samples to store | ||
| without losing precision, and it can be set by specifying the resampler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you want to say without loosing precision. We are loosing precision for when we downsample but that's acceptable in many cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that we can reduce the number of samples without losing much precision through resampling. I'd then remove without losing precision as it is confusing and it isn't generic in the sense it only applies for downsampling where it is somehow implicit an acceptable loss of precision
1cf572d
1cf572d to
5e073fe
Compare
|
Updated considering the latest comment from Matthias |
Signed-off-by: Daniel Zullo <[email protected]>
Modify the MovingWindow class to accept the size parameter as a timedelta object instead of an integer. This change allows the size parameter to represent the time span of the moving window over which samples will be stored, making it more intuitive for users and consistent among other parameters in the MovingWindow class. Signed-off-by: Daniel Zullo <[email protected]>
There is not need at the moment to keep the state of the flag to prevent deep copying of the adjacent buffer in MovingWindow. Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Add a resampler in the MovingWindow to control the granularity of the samples to be stored in the underlying buffer. Signed-off-by: Daniel Zullo <[email protected]>
There were inconsistencies in the way the SDK set datetime variables in the MovingWindow/RingBuffer without tz/tzinfo and in the Resampler with tz/tzinfo. This patch sets the timezone UTC for all datetime variables set in the MovingWindow and RingBuffer to make them consistent to the datetime variables set in the Resampler. Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Signed-off-by: Daniel Zullo <[email protected]>
Change the way the markers are represented in RingBuffer so that `replace()` is not called every time the markers are assigned or compared to. Signed-off-by: Daniel Zullo <[email protected]>
The ISO format is more precise and might be less confusing for the users. Signed-off-by: Daniel Zullo <[email protected]>
5e073fe to
3bc00be
Compare
The test fails when it is run in the CI, increasing the sampling won't solve the problem, just it will fail less ofter. There are already two different open issues to address and fix these flaky tests. See the links below: frequenz-floss#249 frequenz-floss#70 Signed-off-by: Daniel Zullo <[email protected]>
f6ef466 to
5d37033
Compare
Fixes #269