Skip to content

Commit b204148

Browse files
Merge pull request #71 from CSAFE-ISU/52-fix-phase-on-windows
52 fix phase on windows
2 parents 48170f6 + 872a6eb commit b204148

File tree

12 files changed

+32
-23
lines changed

12 files changed

+32
-23
lines changed

R/app.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ bulletAnalyzrApp <- function(
895895
bulldata$comparison <- report_results$comparison
896896
bulldata$comparison_export <- report_results$comparison_export
897897
if (save_diagnostics) {
898-
saveRDS(bulldata, file.path(tempdir(), "bulldata.rds"))
898+
saveRDS(reactiveValuesToList(bulldata), file.path(tempdir(), "bulldata.rds"))
899899
}
900900
})
901901

@@ -918,7 +918,11 @@ bulletAnalyzrApp <- function(
918918
saveRDS(d, file.path(tempdir(), "filtered_data_for_pt.rds"))
919919

920920
tryCatch({
921-
phase$test_results <- bulletxtrctr::phase_test(land1 = d$landA, land2 = d$landB, d$ccf)
921+
phase$test_results <- phase_test_fixed(
922+
land1 = d$landA,
923+
land2 = d$landB,
924+
score = d$ccf
925+
)
922926
saveRDS(phase, file.path(tempdir(), "phase_test.rds"))
923927
}, error = function(e) {
924928
return(d)

tests/testthat/fixtures/make_process_features.R

Lines changed: 0 additions & 14 deletions
This file was deleted.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
6.69 MB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Run the app with save_diagnostics = TRUE to save intermediate files to the
2+
# temporary directory.
3+
4+
# Copy rds files to fixtures > process folder
5+
files <- c("bullet_scores_pre_ss.rds", "bullet_scores_post_ss.rds",
6+
"features.rds", "bulldata.rds")
7+
8+
for (f in files) {
9+
file.rename(
10+
file.path(tempdir(), f),
11+
testthat::test_path("fixtures", "process", f)
12+
)
13+
}
14+
15+
# copy file to fixtures > phase_test folder
16+
file.rename(
17+
file.path(tempdir(), "filtered_data_for_pt.rds"),
18+
testthat::test_path("fixtures", "process", "filtered_data_for_pt.rds")
19+
)
20+

tests/testthat/test-bulletxtrctr-fixed.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
testthat::test_that("bullet to land predict fixed works", {
2-
input <- readRDS(testthat::test_path("fixtures", "bullet_scores_pre_ss.rds"))
2+
input <- readRDS(testthat::test_path("fixtures", "process", "bullet_scores_pre_ss.rds"))
33
input <- input$data[[2]]
44
actual <- bullet_to_land_predict_fixed(
55
land1 = input$landA,
@@ -15,7 +15,7 @@ testthat::test_that("bullet to land predict fixed works", {
1515
})
1616

1717
testthat::test_that("compute average scores fixed works", {
18-
input <- readRDS(testthat::test_path("fixtures", "features.rds"))
18+
input <- readRDS(testthat::test_path("fixtures", "process", "features.rds"))
1919
input <- input %>% dplyr::group_by(bulletA, bulletB) %>% tidyr::nest()
2020
input <- input$data[[1]]
2121
actual <- compute_average_scores_fixed(

0 commit comments

Comments
 (0)