Skip to content

Commit

Permalink
adjust python calls to new cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Jun 28, 2024
1 parent 3a216da commit 1e8e92a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scripts/input/climate_assessment_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ if (any(!alreadySet)) do.call(Sys.setenv, as.list(environmentVariables[!alreadyS
# BUILD climate-assessment RUN COMMANDS
#
runHarmoniseAndInfillCmd <- paste(
"python", file.path(scriptsDir, "run_harm_inf.py"),
"python3.9", file.path(scriptsDir, "run_harm_inf.py"),
climateAssessmentEmi,
climateTempDir,
"--no-inputcheck",
"--infilling-database", infillingDatabaseFile
)

runClimateEmulatorCmd <- paste(
"python", file.path(scriptsDir, "run_clim.py"),
"python3.9", file.path(scriptsDir, "run_clim.py"),
normalizePath(file.path(climateTempDir, paste0(baseFn, "_harmonized_infilled.csv"))),
climateTempDir,
"--num-cfgs", nparsets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ fileAllPulsesClimate <- paste0(normalizePath(climateTempDir), "/allpulses_IAMC_c

# BUILD climate-assessment RUN COMMAND
runClimateEmulatorCmd <- paste(
"python", file.path(scriptsDir, "run_clim.py"),
"python3.9", file.path(scriptsDir, "run_clim.py"),
fileAllPulsesScen,
climateTempDir,
# Note: Option --year-filter-last requires https://github.com/gabriel-abrahao/climate-assessment/tree/yearfilter
Expand Down
8 changes: 4 additions & 4 deletions scripts/output/single/MAGICC7_AR6.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ Sys.setenv(MAGICC_WORKER_NUMBER = 1) # TODO: Get this from slurm or nproc
#deactivate_venv_cmd <- "deactivate"

runHarmoniseAndInfillCmd <- paste(
"python", file.path(scriptsFolder, "run_harm_inf.py"),
"python3.9", file.path(scriptsFolder, "run_harm_inf.py"),
climateAssessmentEmi,
climateAssessmentFolder,
"--no-inputcheck",
"--infilling-database", infillingDatabaseFile
)

runClimateEmulatorCmd <- paste(
"python", file.path(scriptsFolder, "run_clim.py"),
normalizePath(file.path(climateAssessmentFolder, paste0(baseFileName, "_harmonized_infilled.csv"))),
"python3.9", file.path(scriptsFolder, "run_clim.py"),
normalizePath(file.path(climateAssessmentFolder, paste0(baseFileName, "_harmonized_infilled.csv")), mustWork = FALSE),
climateAssessmentFolder,
"--num-cfgs", nparsets,
"--scenario-batch-size", 1,
Expand All @@ -172,7 +172,7 @@ logmsg <- paste0(
" MAGICC_WORKER_ROOT_DIR = ", Sys.getenv("MAGICC_WORKER_ROOT_DIR") ,"\n",
" MAGICC_WORKER_NUMBER = ", Sys.getenv("MAGICC_WORKER_NUMBER") ,"\n",
date(), " =================== RUN climate-assessment infilling & harmonization ===================\n",
runHarmoniseAndInfillCmd, "'\n"
runHarmoniseAndInfillCmd, "\n"
)
cat(logmsg)
capture.output(cat(logmsg), file = logFile, append = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/checkSetup.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (length(missingDeps) > 0) {
message("all required R packages are installed")
}

if (Sys.which("python3") != ""
if (Sys.which("python3.9") != ""
|| (Sys.which("python.exe") != ""
&& suppressWarnings(isTRUE(startsWith(system2("python.exe", "--version", stdout = TRUE), "Python 3"))))) {
message("checking for Python 3 - ok")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#SBATCH --output=PYTHONLOG-%x.%j.out
# Replace this with the resulting xls of output.R -> export -> xlsx_IIASA -> AR6
filename="../../../output/export/REMIND_gabrielAR6SHAPE_2023-05-17_05.12.52.xlsx"
python source_climate_assessment.py $filename
python3.9 source_climate_assessment.py $filename

0 comments on commit 1e8e92a

Please sign in to comment.