Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Additional small changes #403

Merged
merged 13 commits into from
Feb 22, 2021
11 changes: 4 additions & 7 deletions 0_global_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ set_col_types <- function(grouping_variables, fixed_col_types) {
return(port_col_types)
}

set_project_parameters <- function(file_path){
set_project_parameters <- function(file_path) {
cfg <- config::get(file = file_path)

project_report_name <<- cfg$reporting$project_report_name
Expand Down Expand Up @@ -124,7 +124,6 @@ set_project_parameters <- function(file_path){
inc_stresstest <<- FALSE
warning("Warning: inc_stresstest set to standard value (FALSE) as it is not defined in the parameter file")
}

}

set_global_parameters <- function(file_path) {
Expand Down Expand Up @@ -251,7 +250,6 @@ set_git_path <- function() {
}

set_analysis_inputs_path <- function(twodii_internal, data_location_ext, dataprep_ref = datastore_timestamp) {

if (twodii_internal) {
analysis_inputs_path <- r2dii.utils::path_dropbox_2dii("PortCheck", "00_Data", "07_AnalysisInputs", dataprep_ref)
analysis_inputs_path <- file.path(analysis_inputs_path)
Expand All @@ -276,7 +274,7 @@ copy_files <- function(project_name) {

input_file <- paste0(raw_input_path, "/", project_name, "_Input.csv")
parameter_file <- paste0(par_file_path, "/ReportParameters.yml")
yml_file <- paste0(par_file_path, "/AnalysisParameters.yml")
yml_file <- paste0(par_file_path, "/ProjectParameters.yml")

if (!file.exists(input_file)) {
file.copy(paste0(folder_location, "/ProjectName_Input.csv"), input_file, overwrite = F)
Expand All @@ -287,7 +285,7 @@ copy_files <- function(project_name) {
}

if (!file.exists(yml_file)) {
file.copy(paste0(folder_location, "/AnalysisParameters.yml"), yml_file, overwrite = F)
file.copy(paste0(folder_location, "/ProjectParameters.yml"), yml_file, overwrite = F)
}
}

Expand Down Expand Up @@ -364,6 +362,5 @@ write_log <- function(msg, file_path = log_path, ...) {
as.character(msg),
...
)
write(composed, file = file.path(file_path,"error_messages.txt"), append = TRUE)
write(composed, file = file.path(file_path, "error_messages.txt"), append = TRUE)
}

Loading