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

Stabilize ASAP #498

Merged
merged 1 commit into from
Sep 12, 2022
Merged

Stabilize ASAP #498

merged 1 commit into from
Sep 12, 2022

Conversation

WireBaron
Copy link
Contributor

This PR moves the ASAP implementation out of toolkit_experimental. It also removes some of the odd behavior where we were trying to normalize the incoming data points before applying the algorithm (users should do this themselves if this is the behavior they desire). As a result, we should now correctly match the reference implementation exactly, and this change also adds a PR to that effect.

(points.last().unwrap().ts - points.first().unwrap().ts) / points.len() as i64
};
let mut normal = downsample_and_gapfill_to_normal_form(&points, downsample_interval);

let start_ts = points.first().unwrap().ts;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this happen from user error alone? If so, we ought to provide an error message by changing .unwrap() to .expect("points must not be empty") or something. (Same question for another unwrap below in asap_on_timevector)

Is it possible for end_ts to be the same as start_ts and does that matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be impossible to hit during normal use. We exit this function right away if called on None and won't create a Some unless we have at least on value. Similarly we need a time/value pair to create a timevector. If the data is only one point we should just return that point, and, now that I just fixed the div0 we were hitting in that case, we do so.

@WireBaron
Copy link
Contributor Author

bors r+

bors bot added a commit that referenced this pull request Sep 12, 2022
498: Stabilize ASAP r=WireBaron a=WireBaron

This PR moves the ASAP implementation out of toolkit_experimental.  It also removes some of the odd behavior where we were trying to normalize the incoming data points before applying the algorithm (users should do this themselves if this is the behavior they desire).  As a result, we should now correctly match the reference implementation exactly, and this change also adds a PR to that effect.

Co-authored-by: Brian Rowe <[email protected]>
@WireBaron
Copy link
Contributor Author

bors r-

@bors
Copy link
Contributor

bors bot commented Sep 12, 2022

Canceled.

@WireBaron
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 12, 2022

@bors bors bot merged commit 7af7ec6 into main Sep 12, 2022
@bors bors bot deleted the br/asap_stable branch September 12, 2022 22:54
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

Successfully merging this pull request may close these issues.

3 participants