Skip to content

Commit 226d43f

Browse files
add DESCRIPTION
1 parent 3d98cf8 commit 226d43f

File tree

5 files changed

+96
-21
lines changed

5 files changed

+96
-21
lines changed

.Rbuildignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
^renv$
2+
^renv\.lock$

.lintr

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
linters: lucode2::lintrRules()
2+
encoding: "UTF-8"

.snapshot.Rprofile

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ if(file.exists("~/.Rprofile")) source("~/.Rprofile")
55

66
# This profile can be used to link the model to a specified library snapshot
77
# (e.g. if your model version is from an older date and does not work with the
8-
# newest libraries anymore)
8+
# newest libraries anymore).
99
# By default it is not active. Just uncomment the following lines and set the
10-
# snapshot path to a path of your choice
10+
# snapshot path to a path of your choice.
1111
# Please make also sure that in your config file this .Rprofile file is copied
1212
# to the model output folder. Otherwise, the run itself will again use the
1313
# default library set!
1414

1515
# PLEASE NOTE: snapshots ending with '_R4' require R 4.1 (piam/1.24 and newer),
1616
# other snapshots require R 3.6 (piam/1.20)
17-
# snapshot <- "/p/projects/rd3mod/R/libraries/snapshots/2020_03_10"
17+
# snapshot <- "/p/projects/rd3mod/R/libraries/snapshots/2022_10_28_R4"
1818
# if(file.exists(snapshot)) {
1919
# cat("Setting libPaths to",snapshot,"\n")
20-
# .libPaths(snapshot)
20+
# .libPaths(snapshot, include.site = FALSE)
2121
# } else {
2222
# cat("Could not find",snapshot,"\n")
2323
# }

DESCRIPTION

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Package: magpiemodel
2+
Title: MAgPIE - An Open Source land-use modeling framework
3+
Version: 4.5.0
4+
Date: 2022-11-07
5+
Authors@R: c(
6+
person("Jan Philipp", "Dietrich", , "[email protected]"),
7+
person("Benjamin Leon", "Bodirsky", , "[email protected]"),
8+
person("Isabelle", "Weindl", , "[email protected]"),
9+
person("Florian", "Humpenöder", , "[email protected]"),
10+
person("Miodrag", "Stevanovic", , "[email protected]"),
11+
person("Ulrich", "Kreidenweis"),
12+
person("Xiaoxi", "Wang", , "[email protected]"),
13+
person("Kristine", "Karstens", , "[email protected]"),
14+
person("Abhijeet", "Mishra", , "[email protected]"),
15+
person("Felicitas Dorothea", "Beier", , "[email protected]"),
16+
person("Edna Johanna", "Molina Bacca", , "[email protected]"),
17+
person("Patrick", "von Jeetze", , "[email protected]"),
18+
person("Michael", "Windisch", , "[email protected]"),
19+
person("Michael Scott", "Crawford", , "[email protected]"),
20+
person("Debbora", "Leip", , "[email protected]"),
21+
person("David", "Klein", , "[email protected]"),
22+
person("Vartika", "Singh", , "[email protected]"),
23+
person("Geanderson", "Ambrósio", , "[email protected]"),
24+
person("Ewerton", "Araujo", , "[email protected]"),
25+
person("Anne", "Biewald"),
26+
person("Hermann", "Lotze-Campen", , "[email protected]"),
27+
person("Alexander", "Popp", , "[email protected]")
28+
)
29+
Description: The Model of Agricultural Production and its Impact on the
30+
Environment (MAgPIE) is a modular open source framework for modeling
31+
global land-systems, which is coupled to the grid-based dynamic
32+
vegetation model LPJmL, with a spatial resolution of 0.5°x0.5°. It
33+
takes regional economic conditions such as demand for agricultural
34+
commodities, technological development and production costs as well as
35+
spatially explicit data on potential crop yields, land and water
36+
constraints (from LPJmL) into account. Based on these, the model
37+
derives specific land use patterns, yields and total costs of
38+
agricultural production for each grid cell. The objective function of
39+
the land use model is to minimize total cost of production for a given
40+
amount of regional food and bioenergy demand. Regional food energy
41+
demand is defined for an exogenously given population in 10 food
42+
energy categories, based on regional diets. Future trends in food
43+
demand are derived from a cross-country regression analysis, based on
44+
future scenarios on GDP and population growth.
45+
License: modified AGPL3, see LICENSE file
46+
URL: https://github.com/magpiemodel/magpie,
47+
https://doi.org/10.5281/zenodo.1418752
48+
BugReports: https://github.com/magpiemodel/magpie/issues
49+
Imports:
50+
callr,
51+
citation,
52+
curl,
53+
data.table,
54+
dplyr,
55+
gdx,
56+
gdxrrw,
57+
ggplot2,
58+
ggrepel,
59+
gms,
60+
here,
61+
iamc,
62+
lucode2 (>= 0.36.0),
63+
luplot,
64+
luscale,
65+
lusweave,
66+
m4fsdp,
67+
madrat,
68+
magclass,
69+
magpie4,
70+
MagpieNCGains,
71+
magpiesets,
72+
mip,
73+
mrcommons,
74+
patchwork,
75+
quitte,
76+
raster,
77+
remulator,
78+
renv,
79+
stringr,
80+
txtplot,
81+
withr
82+
Encoding: UTF-8
83+
RoxygenNote: 7.2.1

scripts/start_functions.R

+5-17
Original file line numberDiff line numberDiff line change
@@ -275,24 +275,12 @@ start_run <- function(cfg, scenario = NULL, codeCheck = TRUE, lock_model = TRUE)
275275
}
276276

277277
if (getOption("autoRenvUpdates", FALSE)) {
278-
source("scripts/utils/updateRenv.R")
279-
} else {
280-
# TODO create a lucode2 function for checking/installing updates to pik packages?
281-
packagesUrl <- "https://pik-piam.r-universe.dev/src/contrib/PACKAGES"
282-
pikPackages <- sub("^Package: ", "", grep("^Package: ", readLines(packagesUrl), value = TRUE))
283-
installed <- utils::installed.packages()
284-
outdatedPackages <- utils::old.packages(instPkgs = installed[installed[, "Package"] %in% pikPackages, ])
285-
if (!is.null(outdatedPackages)) {
286-
message("The following PIK packages can be updated:\n",
287-
paste("-", outdatedPackages[, "Package"], ":",
288-
outdatedPackages[, "Installed"], "->", outdatedPackages[, "ReposVer"],
289-
collapse = "\n"),
290-
"\nConsider updating with `Rscript scripts/utils/updateRenv.R`.")
291-
}
278+
source("scripts/renv_scripts/updateRenv.R")
279+
} else if (!is.null(lucode2::showUpdates())) {
280+
message("Consider updating with `Rscript scripts/renv_scripts/updateRenv.R`.")
292281
}
293282

294283
createResultsfolderRenv <- function(resultsfolder, lockfile) {
295-
# use same snapshot.type so renv::status()$synchronized always uses the same logic
296284
renv::init(resultsfolder)
297285

298286
# restore same renv as main renv
@@ -301,8 +289,8 @@ start_run <- function(cfg, scenario = NULL, codeCheck = TRUE, lock_model = TRUE)
301289
}
302290
# init renv in a separate session so the libPaths of the current session remain unchanged
303291
callr::r(createResultsfolderRenv,
304-
list(normalizePath(cfg$results_folder), normalizePath(renv::paths$lockfile())),
305-
show = TRUE)
292+
list(normalizePath(cfg$results_folder), normalizePath(renv::paths$lockfile())),
293+
show = TRUE)
306294
}
307295

308296
# If reports for both bioenergy and GHG prices are available convert them

0 commit comments

Comments
 (0)