Skip to content

Commit

Permalink
debug strategies for workign on new platform
Browse files Browse the repository at this point in the history
  • Loading branch information
btupper committed Nov 27, 2023
1 parent 408fc10 commit c5396cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
7 changes: 6 additions & 1 deletion buildZoopModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
23 changes: 22 additions & 1 deletion test.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down

0 comments on commit c5396cd

Please sign in to comment.