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

give .filter_eval_time() more informative warning #1043

Merged
merged 4 commits into from
Jan 11, 2024
Merged

Conversation

EmilHvitfeldt
Copy link
Member

To close #967

I went all in! it is super fancy now

library(parsnip)

times_duplicated <- c(1:9, 1:4, NA, Inf, -4, -4, -3)
parsnip:::.filter_eval_time(times_duplicated)
#> Warning: There were 9 inappropriate evaluation time points that were removed. They were:
#> • 1 missing value.
#> • 1 infinite value.
#> • 3 negative values.
#> • 4 duplicate values.
#> [1] 1 2 3 4 5 6 7 8 9

@EmilHvitfeldt EmilHvitfeldt requested a review from hfrick January 10, 2024 20:24

cli::cli_warn(
c(
"There {?was/were} {diffs} inappropriate evaluation time \\
Copy link
Member

Choose a reason for hiding this comment

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

🤩

Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

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

Looove it! 😍 Does this break any snapshots in extratests?

@@ -32,7 +36,8 @@
parsnip:::.filter_eval_time(times_remove_singular)
Condition
Warning:
There was 1 inappropriate evaluation time point that was removed.
There was 1 inappropriate evaluation time point that was removed. They were:
Copy link
Member

Choose a reason for hiding this comment

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

Nit: They were -> It was. I'll add a suggestion!

R/standalone-survival.R Outdated Show resolved Hide resolved
@EmilHvitfeldt
Copy link
Member Author

i didn't test extratests because I still have a hard time making it run 😓

@topepo
Copy link
Member

topepo commented Jan 11, 2024

I searched the extratests snapshots and didn't see any matches to the old message. Either way, I seem to be updating the snapshots almost every 3h 😄

@EmilHvitfeldt EmilHvitfeldt merged commit 3fb23ca into main Jan 11, 2024
7 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the fix-967 branch January 11, 2024 20:44
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better warning for .filter_eval_time() when removing duplicates
3 participants