Update: source() calls to reference renamed util files (20_, 30_, 40_)

This commit is contained in:
Timon 2026-01-14 11:24:27 +01:00
parent ab19c2b99d
commit 62106eeb3b
5 changed files with 10 additions and 10 deletions

View file

@ -96,9 +96,9 @@ main <- function() {
# Load growth model utils if available (for yield prediction)
tryCatch({
source(here("r_app", "growth_model_utils.R"))
source(here("r_app", "30_growth_model_utils.R"))
}, error = function(e) {
warning("growth_model_utils.R not found, yield prediction KPI will use placeholder data")
warning("30_growth_model_utils.R not found, yield prediction KPI will use placeholder data")
})
# Check if required variables exist

View file

@ -110,12 +110,12 @@ main <- function() {
stop(e)
})
cat("[DEBUG] Attempting to source r_app/ci_extraction_utils.R\n")
cat("[DEBUG] Attempting to source r_app/20_ci_extraction_utils.R\n")
tryCatch({
source("r_app/ci_extraction_utils.R")
cat("[DEBUG] Successfully sourced r_app/ci_extraction_utils.R\n")
source("r_app/20_ci_extraction_utils.R")
cat("[DEBUG] Successfully sourced r_app/20_ci_extraction_utils.R\n")
}, error = function(e) {
cat("[ERROR] Failed to source r_app/ci_extraction_utils.R:\n", e$message, "\n")
cat("[ERROR] Failed to source r_app/20_ci_extraction_utils.R:\n", e$message, "\n")
stop(e)
})

View file

@ -44,12 +44,12 @@ main <- function() {
# Initialize project configuration and load utility functions
tryCatch({
source("parameters_project.R")
source("growth_model_utils.R")
source("30_growth_model_utils.R")
}, error = function(e) {
warning("Default source files not found. Attempting to source from 'r_app' directory.")
tryCatch({
source(here::here("r_app", "parameters_project.R"))
source(here::here("r_app", "growth_model_utils.R"))
source(here::here("r_app", "30_growth_model_utils.R"))
warning(paste("Successfully sourced files from 'r_app' directory."))
}, error = function(e) {

View file

@ -99,14 +99,14 @@ main <- function() {
tryCatch({
source("parameters_project.R")
source("mosaic_creation_utils.R")
source("40_mosaic_creation_utils.R")
safe_log(paste("Successfully sourced files from default directory."))
}, error = function(e) {
message("Note: Could not open files from default directory (expected on some systems)")
message("Attempting to source from 'r_app' directory instead...")
tryCatch({
source(here::here("r_app", "parameters_project.R"))
source(here::here("r_app", "mosaic_creation_utils.R"))
source(here::here("r_app", "40_mosaic_creation_utils.R"))
message("✓ Successfully sourced files from 'r_app' directory")
}, error = function(e) {
stop("Failed to source required files from both default and 'r_app' directories.")