Skip to content

Commit

Permalink
add 'make test-fix': check-fix and then test
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Mar 19, 2024
1 parent 39e9864 commit 5b76090
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **21_tax** add SE tax on electricity going into electrolysis for hydrogen production
- **scripts** add compareScenarios section for MAGICC7 AR6 output
[[#1615](https://github.com/remindmodel/remind/pull/1615)
- **scripts** add 'make test-fix' which runs codeCheck in interactive mode, adjusting not_used.txt files
[[#1625](https://github.com/remindmodel/remind/pull/1625)

### fixed
- fixed weights of energy carriers in `pm_IndstCO2Captured`
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Imports:
gdxdt,
gdxrrw,
ggplot2,
gms (>= 0.30.5),
gms (>= 0.30.7),
goxygen,
gridExtra,
gtools,
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ test: ## Test if the model compiles and runs without running a full
$(info Tests take about 15 minutes to run, please be patient)
@Rscript -e 'testthat::test_dir("tests/testthat")'

test-fix: ## First run codeCheck interactively, then test if the model compiles and runs without
## running a full scenario. Tests take about 15 minutes to run.
$(info Tests take about 18 minutes to run, please be patient)
@Rscript -e 'invisible(gms::codeCheck(strict = TRUE, interactive = TRUE)); testthat::test_dir("tests/testthat"); message("Do not forget to commit changes done by codeCheck to not_used.txt files");'

test-coupled: ## Test if the coupling with MAgPIE works. Takes significantly
## longer than 60 minutes to run and needs slurm and magpie
## available
Expand Down
4 changes: 2 additions & 2 deletions modules/30_biomass/magpie_40/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ p30_pebiolc_costs_emu_preloop(ttot,all_regi) "Bioenergy costs calculated with
p30_pebiolc_price_emu_preloop(ttot,all_regi) "Bioenergy price calculated with emulator using MAgPIE demand. For shift factor calculation [T$US/TWa]"
p30_pebiolc_price_emu_preloop_shifted(ttot,all_regi) "Bioenergy price calculated with emulator using MAgPIE demand after shift factor calculation [T$US/TWa]"
p30_pebiolc_pricshift(ttot,all_regi) "Regional translation factor that shifts emulator prices to better fit actual MAgPIE prices [-]"
p30_pebiolc_pricmult(ttot,all_regi) "Regional multiplication factor that sclaes emulator prices to better fit actual MAgPIE prices [-]"
p30_pebiolc_pricmult(ttot,all_regi) "Regional multiplication factor that scales emulator prices to better fit actual MAgPIE prices [-]"

*** Parameters for regression of MAgPIE prices and costs ("MAgPIE emulator")

Expand All @@ -53,7 +53,7 @@ v30_shift_r2 "Least square to minimize during shift calcul

Positive variable
v30_priceshift(ttot,all_regi) "Regional translation factor that shifts emulator prices to better fit actual MAgPIE prices [-]"
v30_pricemult(ttot,all_regi) "Regional multiplication factor that sclaes emulator prices to better fit actual MAgPIE prices [-]"
v30_pricemult(ttot,all_regi) "Regional multiplication factor that scales emulator prices to better fit actual MAgPIE prices [-]"
v30_multcost(ttot,all_regi) "Cost markup factor for deviations from demand of last coupling iteration [-]"
v30_BioPEProdTotal(ttot,all_regi) "total domestic PE biomass production [unit: TWyr]"
***v30_pedem_BAU(tall,all_regi,all_enty,all_enty,all_te) "Primary energy demand imported from refernce gdx [TWa]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
test_that("GAMS code follows the coding etiquette", {
# have to run this via localSystem2 so that it uses the renv, where gms
# is actually installed.
codecheckcode <- "'invisible(gms::codeCheck(strict=TRUE)); if (! is.null(warnings())) stop(warnings())'"
codecheckcode <- "'invisible(gms::codeCheck(strict = TRUE)); if (! is.null(warnings())) stop(warnings())'"
output <- localSystem2("Rscript", c("-e", codecheckcode))
printIfFailed(output)
expectSuccessStatus(output)
Expand Down

0 comments on commit 5b76090

Please sign in to comment.