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

rsplit obj_sum changes for r-lib/pillar#240 as well as #214 #215

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

* A few internal functions were exported so that `rsample`-adjacent packages can use the same underlying code.

* The `obj_sum()` method for `rsplit` objects was updated.

# rsample 0.0.8

Expand Down
2 changes: 1 addition & 1 deletion R/rsplit.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ obj_sum.rsplit <- function(x, ...) {
else
paste(length(x$out_id))

paste0("rsplit [",
paste0("split [",
length(x$in_id), "/",
out_char, "]")
}
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/print_test_output/obj_sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
> set.seed(233)
> print(validation_split(mtcars))
# Validation Set Split (0.75/0.25)
# A tibble: 1 x 2
splits id
<list> <chr>
1 <split [24/8]> validation

4 changes: 4 additions & 0 deletions tests/testthat/test_rsplit.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ test_that('print methods', {
set.seed(233)
print(validation_split(mtcars)$splits[[1]])
})
verify_output(test_path("print_test_output", "obj_sum"), {
set.seed(233)
print(validation_split(mtcars))
})
})


Expand Down