-
Notifications
You must be signed in to change notification settings - Fork 2
/
02-configure.R
42 lines (30 loc) · 1.59 KB
/
02-configure.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
source("01b-exptTbl.R") ## TODO
# configure project ---------------------------------------------------------------------------
config <- SpaDES.config::useConfig(projectName = "LandWeb", projectPath = prjDir,
mode = .mode, rep = .rep, res = .res,
studyAreaName = .studyAreaName, version = .version)
if (.version == 2) {
config$context[["dispersalType"]] <- .dispersalType
config$context[["ROStype"]] <- .ROStype
config$update()
config$validate()
}
## apply user and machine context settings here
source("02a-user-config.R")
config$args <- config.user$args
#config$modules <- config.user$modules ## no modules should differ among users/machines
config$options <- config.user$options
config$params <- config.user$params
config$paths <- config.user$paths
# print run info ------------------------------------------------------------------------------
SpaDES.config::printRunInfo(config$context)
config$modules
# project paths -------------------------------------------------------------------------------
config$paths
stopifnot(identical(checkPath(config$paths[["projectPath"]]), getwd()))
checkPath(config$paths[["logPath"]], create = TRUE) ## others will be created as needed below
paths <- SpaDES.config::paths4spades(config$paths)
# project options -----------------------------------------------------------------------------
opts <- SpaDES.config::setProjectOptions(config)
quickPlot::dev.useRSGD(useRSGD = quickPlot::isRstudioServer())
SpaDES.config::authGoogle(tryToken = "landweb", tryEmail = config$args[["cloud"]][["googleUser"]])