Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:remindmodel/remind into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dklein-pik committed Dec 2, 2024
2 parents 6987cb7 + d06a23c commit 44a0dfa
Show file tree
Hide file tree
Showing 101 changed files with 2,555 additions and 2,049 deletions.
20 changes: 0 additions & 20 deletions .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,6 @@ if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) {
message("Finished installing R package dependencies.")
}

# bootstrapping python venv, will only run once after remind is freshly cloned
if (!dir.exists(".venv/")
&& (Sys.which("python3") != ""
|| (Sys.which("python.exe") != ""
&& suppressWarnings(isTRUE(startsWith(system2("python.exe", "--version", stdout = TRUE), "Python 3")))
))) {
message("Python venv is not available, setting up now...")
# use system python to set up venv
if (.Platform$OS.type == "windows") {
system2("python.exe", c("-mvenv", ".venv"))
pythonInVenv <- normalizePath(file.path(".venv", "Scripts", "python.exe"), mustWork = TRUE)
} else {
system2("python3", c("-mvenv", ".venv"))
pythonInVenv <- normalizePath(file.path(".venv", "bin", "python"), mustWork = TRUE)
}
# use venv python to install dependencies in venv
system2(pythonInVenv, c("-mpip", "install", "--upgrade", "pip", "wheel"))
system2(pythonInVenv, c("-mpip", "install", "-r", "requirements.txt"))
}

# Configure locations of REMIND input data
# These can be located in directories on the local machine, remote directories,
# or default directories on the cluster.
Expand Down
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### input data/calibration
- new input data rev6.84 [[#1757](https://github.com/remindmodel/remind/pull/1757)]
- new input data rev6.95 in US$2017[[#1812]] (https://github.com/remindmodel/remind/pull/1812)
- new input data rev7.13 including new MAgPIE emulators [[#1886]] (https://github.com/remindmodel/remind/pull/1886)
- CES parameter and gdx files calibrated with new default diffLin2Lin for NPi
[[#1747](https://github.com/remindmodel/remind/pull/1747)] and
[[#1757](https://github.com/remindmodel/remind/pull/1757)]
Expand All @@ -29,16 +30,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **core** changed adjustment cost of geohe (central heat pumps), elh2 (electrolysis), MeOH (FT-Synthesis: H2-to-Liquids)
and h22ch4 (methanation: H2-to-Gas) to better reflect upscaling dynamics
[[#1823](https://github.com/remindmodel/remind/pull/1823)]
- **core** increase electrolysis CAPEX and slightly adjust default setting for electrolysis taxation and flexibility benefit,
add near-term bounds for electrolysis and synthetic fuel deployment
[[#1882](https://github.com/remindmodel/remind/pull/1882)]
- **core** update co2 capture rates and cost of biomass liquids and gas and some other X-to-Liq/Gas technologies to be internally consistent
[[#1881](https://github.com/remindmodel/remind/pull/1881)]

### added
- **32_power** increase minimum required dispatchable back-up capacity for VRE integration
[[#1789](https://github.com/remindmodel/remind/pull/1789)]
- **33_CDR** added ocean alkalinity enhancement to the CDR portfolio (OAE is turned off by default)
[[#1777](https://github.com/remindmodel/remind/pull/1777)]
- **45_carbonprice** added realizations diffExp2Lin and diffLin2Lin
[[#1723](https://github.com/remindmodel/remind/pull/1723)]
-_**45_carbonprice** added realizations NPi2025_EUR55 and NPiexpo
[[#1851](https://github.com/remindmodel/remind/pull/1851)]
- **45_carbonprice** added realization functionalForm
[[#1874](https://github.com/remindmodel/remind/pull/1874)] and [[#1723](https://github.com/remindmodel/remind/pull/1723)]
- **45_carbonprice** added realizations NPi2025, NPi2025expo and NPiexpo
[[#1851](https://github.com/remindmodel/remind/pull/1851)] and
[[#1888](https://github.com/remindmodel/remind/pull/1888)]
- **50_damages**, **51_internalizeDamages** add KotzWenz realization based on Kotz & Wenz (2024)
[[#1601](https://github.com/remindmodel/remind/pull/1601)]
- **config** add ELEVATE2p3 config
Expand Down Expand Up @@ -83,7 +90,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **scripts** REMIND-MAgPIE start scripts now correctly use all non-gms cfg switches
[[#1768](https://github.com/remindmodel/remind/pull/1768)]
- **scripts** limit slurm runtime of output.R scripts to 2 hours
[[1783](https://github.com/remindmodel/remind/pull/1783)]
[[#1783](https://github.com/remindmodel/remind/pull/1783)]
- **30_biomass** reset 1st gen. biofuel bound from 2045 to 2030
[[#1890](https://github.com/remindmodel/remind/pull/1890)]

### removed
- **45_carbonprice** removed superseded realizations linear, exponential and diffCurvPhaseIn2Lin
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ abstract: REMIND (REgional Model of Investment and Development) is a numerical
technology, policy and climate constraints. It also accounts for regional trade
characteristics on goods, energy fuels, and emissions allowances. All greenhouse
gas emissions due to human activities are represented in the model.
version: "3.3.2.dev916"
date-released: 2024-11-07
version: "3.3.2.dev1058"
date-released: 2024-12-02
repository-code: https://github.com/remindmodel/remind
keywords:
- energy
Expand Down
55 changes: 39 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ 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()'
@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

revert-dev-packages: ## All PIK-PIAM packages that are development versions, i.e.
## that have a non-zero fourth version number component, are
Expand All @@ -47,13 +38,6 @@ 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")'
@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 @@ -62,6 +46,45 @@ restore-renv: ## Restore renv to the state described in interactively
## selected renv.lock from the archive or a run folder.
Rscript -e 'piamenv::restoreRenv()'

clone-conda: ## Clone the specified conda environment or the active environment to a new environment in the user's home directory or specified DEST
@if [ -z "$$ENV" ] && [ -z "$$CONDA_DEFAULT_ENV" ]; then \
echo "No Conda environment specified and no active Conda environment found."; \
exit 1; \
elif [ -z "$$ENV" ]; then \
ENV=$$CONDA_DEFAULT_ENV; \
fi; \
TIMESTAMP=$$(date +%Y%m%d); \
BASENAME=$$(basename $$ENV); \
DEFAULT_CONDA_ENV_DIR=~/.conda/envs; \
CLONE_DIR=$${DEST:-$$DEFAULT_CONDA_ENV_DIR/$$BASENAME-clone-$$TIMESTAMP}; \
echo "Cloning Conda environment: $$ENV"; \
echo "Cloning to: $$CLONE_DIR"; \
echo "This might take a few minutes..."; \
if conda create --prefix $$CLONE_DIR --clone $$ENV; then \
echo "Done!"; \
conda env export --prefix $$CLONE_DIR > $$CLONE_DIR.yml; \
echo "Cloned environment saved to $$CLONE_DIR.yml"; \
else \
echo "Cloning failed or was interrupted."; \
exit 1; \
fi;

create-conda: ## Create a conda environment from the config/py_requirements.txt file
@if [ ! -f config/py_requirements.txt ]; then \
echo "Requirements file not found: config/py_requirements.txt"; \
exit 1; \
fi; \
ENV=$${ENV:-remind}; \
DEST=$${DEST:-$$HOME/.conda/envs}; \
echo "Creating Conda environment: $$DEST/$$ENV with Python 3.11"; \
mkdir -p $$DEST; \
conda create --prefix $$DEST/$$ENV python=3.11 -y; \
echo "Activating Conda environment: $$ENV"; \
. $$(conda info --base)/etc/profile.d/conda.sh && conda activate $$DEST/$$ENV && \
echo "Installing requirements from config/py_requirements.txt"; \
pip install -r config/py_requirements.txt; \
echo "Conda environment $$ENV created and requirements installed successfully in $$DEST with Python 3.11.";

check: ## Check if the GAMS code follows the coding etiquette
## using gms::codeCheck
Rscript -e 'options(warn = 1); invisible(gms::codeCheck(strict = TRUE));'
Expand Down
17 changes: 12 additions & 5 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ cfg$regionmapping <- "config/regionmappingH12.csv"
cfg$extramappings_historic <- ""

#### Current input data revision (<mainrevision>.<subrevision>) ####
cfg$inputRevision <- "7.11"
cfg$inputRevision <- "7.16"

#### Current CES parameter and GDX revision (commit hash) ####
cfg$CESandGDXversion <- "84b10b9308f97fae38923762b840b8dffd456568"
cfg$CESandGDXversion <- "5452a611b8add9f439df0a98a27277a306ece286"

#### Force the model to download new input data ####
cfg$force_download <- FALSE
Expand Down Expand Up @@ -73,7 +73,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.3.2.dev916"
cfg$model_version <- "3.3.2.dev1058"

#### settings ####
cfg$gms <- list()
Expand Down Expand Up @@ -109,8 +109,15 @@ cfg$action <- "ce" #def <- ce
# --qos, --nodes, --tasks-per-node, -job-name, --output, --mail-type, --comment.
cfg$slurmConfig <- ""

# Enable Python integration to interface with other Python-based models
cfg$pythonEnabled <- "off" # def <- off
# Enable Python integration to interface with specialized, Python-based simulation models
# Python/reticulate support is enabled per default in REMIND. If you want to disable it, set the following variable to "off".
cfg$pythonEnabled <- "on"
# Examples:
# "/p/projects/rd3mod/python/environments/scm_magicc7_hpc/" -> Recommended for users of PIK computing infrastructure
# "~/.conda/envs/<environment name>" -> Recommended for users outside of PIK: Use a dedicated conda (= virtual Python) environment in your home directory
# "" -> Empty string: Will use the system Python on typical Linux systems (this is discouraged)
cfg$pythonPath <- "/p/projects/rd3mod/python/environments/scm_magicc7_hpc/"
cfg$ignorePythonRequirements <- "false"

# Should REMIND output be shown in console? (0:no, 2:logfile, 3:yes)
cfg$logoption <- 2
Expand Down
15 changes: 15 additions & 0 deletions config/py_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK)
# | authors, and contributors see CITATION.cff file. This file is part
# | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of
# | AGPL-3.0, you are granted additional permissions described in the
# | REMIND License Exception, version 1.0 (see LICENSE file).
# | Contact: [email protected]
# Use Gabriels version of climate_assessment
climate-assessment @ git+https://github.com/gabriel-abrahao/climate-assessment.git@5d4d81ffed1d2af9cb463608b9a41d91ed02ea63

# netcdf for HDF5 support
netCDF4>=1.6.0

# No new numpy, no old pandas
numpy<3
pandas>2
Loading

0 comments on commit 44a0dfa

Please sign in to comment.