From c5396cda66e1e776dc759963524a7d4fa97c2559 Mon Sep 17 00:00:00 2001 From: Ben Tupper Date: Mon, 27 Nov 2023 13:57:52 -0500 Subject: [PATCH] debug strategies for workign on new platform --- buildZoopModel.R | 7 ++++++- test.R | 23 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/buildZoopModel.R b/buildZoopModel.R index e0acd50..aa30dc9 100644 --- a/buildZoopModel.R +++ b/buildZoopModel.R @@ -31,7 +31,12 @@ version = "vtest.percentile.method.pcal" fp_md = "../calanus_data/Data/Databases/zooplankton_covar_data" species = "ctyp" biomod_dataset = "ECOMON" -fp_covars = "Env_Covars" +hostname = system("hostname", intern = TRUE) +fp_covars = if (grepl("ecocast", hostname, fixed = TRUE)){ + "/mnt/s1/projects/ecocast/projectdata/calanus4whales/Env_Covars" +} else { + "Env_Covars" +} env_covars = c("wind", "int_chl", "sst", "sst_grad", "jday", "uv_grad", "bat", "slope", "bots", "bott") years = 2003:2017 fp_out = "../Models.Test" diff --git a/test.R b/test.R index 977f169..c715db1 100644 --- a/test.R +++ b/test.R @@ -20,13 +20,19 @@ if (!dir.exists(fp_config)) { # Whether to overwrite yaml file, if one already exists overwrite <- FALSE +hostname = system("hostname", intern = TRUE) + # Example parameters for test run params <- list( version = "vtest.percentile.method.ctyp", fp_md = "../calanus_data/Data/Databases/zooplankton_covar_data", species = "ctyp", biomod_dataset = "ECOMON", - fp_covars = "Env_Covars", + fp_covars = if (grepl("ecocast", hostname, fixed = TRUE)){ + "/mnt/s1/projects/ecocast/projectdata/calanus4whales/Env_Covars" + } else { + "Env_Covars" + }, env_covars = c("int_chl", "sst", "bat"), years = 2003:2006, fp_out = "../Models.Test", @@ -49,6 +55,21 @@ if (!dir.exists(dir_version) | overwrite) { # Read in parameters (a bit redundant, but makes it traceable, ideally YAML is written in separate file) config <- yaml::read_yaml(filename) +if (FALSE){ + version = config$version + fp_md = config$fp_md + species = config$species + biomod_dataset = config$biomod_dataset + fp_covars = config$fp_covars + env_covars = config$env_covars + years = config$years + fp_out = config$fp_out + threshold = config$threshold + format_data = config$format_data + overwrite_proj = TRUE + fp_zpd = NULL +} + threshold <- buildZoopModel(version = config$version, fp_md = config$fp_md, species = config$species,