You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, pir_params$twinning_params$twin_evidence_filename is allowed to be a string, even if there is no evidence estimated. This is confusing.
To Reproduce
Script to reproduce the behavior:
test_that("use, twinning, no evidence estimation", {
pir_params<- create_test_pir_params(
twinning_params= create_twinning_params()
)
filenames<- get_pir_params_filenames(pir_params)
# Initialize so the tracelog and treelog filenames are filled inpir_params<- init_pir_params(pir_params)
# Evidence is never estimated, thus no evidence files
expect_false(will_measure_evidence(pir_params))
expect_false(pir_params$evidence_filename%in%filenames)
expect_false(pir_params$twinning_params$twin_evidence_filename%in%filenames)
})
Expected behavior
check_pir_params should call stop.
Screenshots
NA
Environment:
Show the results of running the following script:
test_that("evidence_filename only when there are candidates", {
pir_params<- create_test_pir_params_setup(
has_candidate=FALSE,
has_twinning=FALSE
)
pir_params$evidence_filename<-"should_be_na.csv"
expect_error(
check_pir_params(pir_params),
"'evidence_filename' must be NA if there is no evidence estimation"
)
pir_params<- create_test_pir_params_setup(
has_candidate=TRUE,
has_twinning=FALSE
)
pir_params$evidence_filename<-NA
expect_error(
check_pir_params(pir_params),
"'evidence_filename' must be a string if there is an evidence estimation"
)
pir_params<- create_test_pir_params_setup(
has_candidate=FALSE,
has_twinning=TRUE
)
pir_params$twinning_params$twin_evidence_filename<-"should_be_na.csv"
expect_error(
check_pir_params(pir_params),
paste0(
"'twinning_params$evidence_filename' must be NA ",
"if there is no evidence estimation"
)
)
pir_params<- create_test_pir_params_setup(
has_candidate=TRUE,
has_twinning=TRUE
)
pir_params$twinning_params$twin_evidence_filename<-NA
expect_error(
check_pir_params(pir_params),
paste0(
"'twinning_params$evidence_filename' must be a string ",
"if there is an evidence estimation"
)
)
})
Describe the bug
Currently,
pir_params$twinning_params$twin_evidence_filename
is allowed to be a string, even if there is no evidence estimated. This is confusing.To Reproduce
Script to reproduce the behavior:
Expected behavior
check_pir_params
should callstop
.Screenshots
NA
Environment:
Show the results of running the following script:
Additional context
NA
The text was updated successfully, but these errors were encountered: