Skip to content

Commit

Permalink
integrate scale_x, scale_y PerfPlotSpec attributes into test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
lgessl committed Jan 22, 2024
1 parent 8597778 commit 2b88935
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/testthat/test-assess_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test_that("assess_model() works", {
y_metric = "prec",
pivot_time_cutoff = 2.,
benchmark = "ipi",
show_plots = FALSE
show_plots = TRUE
)

for(model_spec in list(model_spec_1, model_spec_2)){
Expand All @@ -73,9 +73,10 @@ test_that("assess_model() works", {
expect_s3_class(tbl, "tbl_df")


perf_plot_spec$benchmark <- NULL
perf_plot_spec$benchmark <- "ipi"
perf_plot_spec$directory <- file.path(dir, "logrank.pdf")
perf_plot_spec$y_metric <- "logrank"
perf_plot_spec$scale_y <- "log10"
tbl <- assess_model(
expr_mat = expr_mat,
pheno_tbl = pheno_tbl,
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-assessment_center.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ test_that("assessment_center() works", {
expect_true(file.exists(file.path(res_dir, "cox/2/rpp_vs_prec.csv")))

perf_plot_spec$y_metric <- "logrank"
perf_plot_spec$scale_y <- "log10"
perf_plot_spec$fname <- file.path(model_dir, "logrank.pdf")
perf_plot_spec$benchmark <- NULL
perf_plot_spec$scores_plot <- FALSE
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ test_that("plot_2d_metric() works", {
y_lab = "that y lab",
xlim = c(0, .9),
smooth_method = "loess",
smooth_benchmark = TRUE
smooth_benchmark = TRUE,
scale_x = "log10"
)
perf_plot_spec$data <- tibble::tibble(
rpp = runif(n_row),
Expand Down

0 comments on commit 2b88935

Please sign in to comment.