Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/remindmodel/remind into …
Browse files Browse the repository at this point in the history
…CampScens_remind
  • Loading branch information
jmuessel committed Nov 30, 2023
2 parents f91a82d + 4d5793c commit 9f5cb7f
Show file tree
Hide file tree
Showing 130 changed files with 1,673 additions and 323,807 deletions.
10 changes: 10 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,14 @@ if (use_cluster_defaults &&
"/p/projects/remind/inputdata/CESparametersAndGDX" = NULL))
}

# Include local calibration results, if they exist, from either the main
# directory or output directories.
path <- file.path(
c('.', file.path('..', '..')),
'calibration_results', '.Rprofile_calibration_results')

path <- head(path[file.exists(path)], 1)

if (!rlang::is_empty(path))
source(path)
})
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ runtime.rds
# ignore slurm logs
slurm-[0-9]*.log
slurm-[0-9]*.out
calibration_results/
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- let preempted and resumed runs start their subsequent runs
[[#1414](https://github.com/remindmodel/remind/pull/1414)]
- correctly report `Tech|*|Capital Costs|w/ Adj Costs` for t < cm_startyear
[[#1429](https://github.com/remindmodel/remind/pull/1429)]
[[#1429](https://github.com/remindmodel/remind/pull/1429), [#1476](https://github.com/remindmodel/remind/pull/1476)]

## [3.2.1] - 2023-07-13 (incomplete)

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ authors:
affiliation: "Potsdam Institute for Climate Impact Research"

title: REMIND - REgional Model of INvestments and Development
version: "3.2.1.dev350"
date-released: 2023-11-10
version: "3.2.1.dev453"
date-released: 2023-11-29
repository-code: https://github.com/remindmodel/remind
keywords:
- energy
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Imports:
SPEI,
stringr,
terra,
testthat (>= 3.1.10),
testthat (>= 3.2.0),
tibble,
tidyr,
tidyverse,
Expand Down
51 changes: 36 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.PHONY: help docs update-renv update-renv-all archive-renv restore-renv check check-fix test test-coupled test-full
.PHONY: help docs update-renv update-renv-all archive-renv restore-renv check \
check-fix test test-coupled test-full set-local-calibration
.DEFAULT_GOAL := help

# extracts the help text and formats it nicely
HELP_PARSING = 'm <- readLines("Makefile");\
m <- grep("\#\#", m, value=TRUE);\
command <- sub("^([^ ]*) *\#\#(.*)", "\\1", m);\
help <- sub("^([^ ]*) *\#\#(.*)", "\\2", m);\
cat(sprintf("%-18s%s", command, help), sep="\n")'
HELP_PARSING = 'm <- grep("\#\#", readLines("Makefile"), value = TRUE);\
parse <- "^([^[[:space:]]*)[[:space:]]*\#\#[[:space:]]*(.*)";\
command <- sub(parse, "\\1", m, perl = TRUE);\
help <- sub(parse, "\\2", m, perl = TRUE);\
i <- grep("^$$", command, invert = TRUE)[-1];\
command[i] <- paste0("\n", command[i]);\
help[i] <- paste0(" ", help[i]);\
cat(sprintf("%-*s%s", max(nchar(command)), command, help),\
sep = "\n")'

help: ## Show this help.
@Rscript -e $(HELP_PARSING)
Expand All @@ -22,15 +27,27 @@ update-renv: ## Upgrade all pik-piam packages in your renv to the respective
update-renv-all: ## Upgrade all packages (including CRAN packages) in your renv
## to the respective latest release, write renv.lock archive
## Upgrade all packages in python venv, if python venv exists
Rscript -e 'renv::update(exclude = "renv"); piamenv::archiveRenv()'
[ -e ".venv/bin/python" ] && .venv/bin/python -mpip install --upgrade pip wheel
[ -e ".venv/bin/python" ] && .venv/bin/python -mpip install --upgrade --upgrade-strategy eager -r requirements.txt
@Rscript -e 'renv::update(exclude = "renv"); piamenv::archiveRenv()'
@if [ -e "./venv/bin/python" ]; then \
pv_maj=$$( .venv/bin/python -V | sed 's/^Python \([0-9]\).*/\1/' ); \
pv_min=$$( .venv/bin/python -V | sed 's/^Python [0-9]\.\([0-9]\+\).*/\1/' ); \
if (( 3 == $$pv_maj )) && (( 7 <= $$pv_min )) && (( $pv_min < 11 )); then \
.venv/bin/python -mpip install --upgrade pip wheel; \
.venv/bin/python -mpip install --upgrade --upgrade-strategy eager -r requirements.txt; \
fi \
fi

ensure-reqs: ## Ensure the REMIND library requirements are fulfilled
## by installing updates and new libraries as necessary. Does not
## install updates unless it is required.
@Rscript -e 'source("scripts/start/ensureRequirementsInstalled.R"); ensureRequirementsInstalled(rerunPrompt="make ensure-reqs")'
@[ -e ".venv/bin/python" ] && .venv/bin/python -mpip -qq install -r requirements.txt
@if [ -e "./venv/bin/python" ]; then \
pv_maj=$$( .venv/bin/python -V | sed 's/^Python \([0-9]\).*/\1/' ); \
pv_min=$$( .venv/bin/python -V | sed 's/^Python [0-9]\.\([0-9]\+\).*/\1/' ); \
if (( 3 == $$pv_maj )) && (( 7 <= $$pv_min )) && (( $pv_min < 11 )); then \
.venv/bin/python -mpip -qq install -r requirements.txt; \
fi \
fi

archive-renv: ## Write renv.lock into archive.
Rscript -e 'piamenv::archiveRenv()'
Expand All @@ -50,14 +67,14 @@ check-fix: ## Check if the GAMS code follows the coding etiquette

test: ## Test if the model compiles and runs without running a full
## scenario. Tests take about 10 minutes to run.
$(info Tests take about 10 minutes to run, please be patient)
@R_PROFILE_USER= Rscript -e 'testthat::test_dir("tests/testthat")'
$(info Tests take about 20 minutes to run, please be patient)
@Rscript -e 'testthat::test_dir("tests/testthat")'

test-coupled: ## Test if the coupling with MAgPIE works. Takes significantly
## longer than 60 minutes to run and needs slurm and magpie
## available
$(info Coupling tests take around 75 minutes to run, please be patient)
@R_PROFILE_USER= TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_file("tests/testthat/test_20-coupled.R")'
@TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_file("tests/testthat/test_20-coupled.R")'

test-coupled-slurm: ## test-coupled, but on slurm
$(info Coupling tests take around 75 minutes to run. Sent to slurm, find log in test-coupled.log)
Expand All @@ -66,7 +83,11 @@ test-coupled-slurm: ## test-coupled, but on slurm
test-full: ## Run all tests, including coupling tests and a default
## REMIND scenario. Takes significantly longer than 10 minutes to run.
$(info Full tests take more than an hour to run, please be patient)
@R_PROFILE_USER= TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat")'
@TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat")'
test-validation: ## Run validation tests, requires a full set of runs in the output folder
$(info Run validation tests, requires a full set of runs in the output folder)
@R_PROFILE_USER= TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat/validation")'
@TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat/validation")'

set-local-calibration: ## set up local calibration results directory
@./scripts/utils/set-local-calibration.sh
$(info use `collect_calibration` script in calibration_results/ directory )
6 changes: 3 additions & 3 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ cfg$regionmapping <- "config/regionmappingH12.csv"
### Additional (optional) region mapping, so that those validation data can be loaded that contain the corresponding additional regions.
cfg$extramappings_historic <- ""
#### Current input data revision (<mainrevision>.<subrevision>) ####
cfg$inputRevision <- "6.544"
cfg$inputRevision <- "6.605"

#### Current CES parameter and GDX revision (commit hash) ####
cfg$CESandGDXversion <- "216c0ede4f08158971a8aa8a80de94387e031809"
cfg$CESandGDXversion <- "8a227c12c2690ee45bd9a278a51fca9e7162b1b4"

#### Force the model to download new input data ####
cfg$force_download <- FALSE
Expand Down Expand Up @@ -63,7 +63,7 @@ cfg$validationmodel_name <- "VALIDATIONREMIND"

#### model version of the overall model (used for run statistics only).
# automatically generated for development versions, updated by hand for releases
cfg$model_version <- "3.2.1.dev350"
cfg$model_version <- "3.2.1.dev453"

#### settings ####
cfg$gms <- list()
Expand Down
Loading

0 comments on commit 9f5cb7f

Please sign in to comment.