Skip to contents

Read default configuration of the package and complete it with eventual user config

Usage

loadConfig(
  userFile = "config.yml",
  config = Sys.getenv("R_CONFIG_ACTIVE", "default"),
  pathDefaultCfg = system.file("config.yml", package = "seinebasin2")
)

Arguments

userFile

location of the user config YML file

config

Name of configuration to read from. Defaults to the value of the R_CONFIG_ACTIVE environment variable ("default" if the variable does not exist).

pathDefaultCfg

The location of the default configuration (located in "inst/config.yml" of the package by default)

Value

A configuration as it is returned by config::get

Examples

cfg <- loadConfig()
str(cfg)
#> List of 9
#>  $ data          :List of 3
#>   ..$ cloud        : logi TRUE
#>   ..$ path         : chr "https://nextcloud.inrae.fr/s/adinzGa3AmLEXnZ/download?path="
#>   ..$ write_results: logi FALSE
#>  $ hydroclim     :List of 2
#>   ..$ drias:List of 7
#>   .. ..$ bbox     :List of 2
#>   .. .. ..$ x:List of 2
#>   .. .. .. ..$ min: int 532000
#>   .. .. .. ..$ max: int 844000
#>   .. .. ..$ y:List of 2
#>   .. .. .. ..$ min: int 2217000
#>   .. .. .. ..$ max: int 2561000
#>   .. ..$ periods  :List of 4
#>   .. .. ..$ ref   : chr [1:2] "1976-01-01" "2005-12-31"
#>   .. .. ..$ near  : chr [1:2] "2021-01-01" "2050-12-31"
#>   .. .. ..$ middle: chr [1:2] "2041-01-01" "2070-12-31"
#>   .. .. ..$ end   : chr [1:2] "2071-01-01" "2100-12-31"
#>   .. ..$ source   : chr "DRIAS2020_NEW"
#>   .. ..$ url      : chr "https://climatedata.umr-cnrm.fr/public/dcsc/projects/DRIAS/DRIAS2020_NEW/"
#>   .. ..$ scenarios: chr [1:11] "CNRM-CERFACS-CNRM-CM5/CNRM-ALADIN63" "CNRM-CERFACS-CNRM-CM5/KNMI-RACMO22E" "ICHEC-EC-EARTH/KNMI-RACMO22E" "ICHEC-EC-EARTH/SMHI-RCA4" ...
#>   .. ..$ variables: chr [1:2] "prtotAdjust" "tasAdjust"
#>   .. ..$ rcp      : chr [1:3] "historical" "rcp45" "rcp85"
#>   ..$ path : chr "01-hydroclimatic"
#>  $ reservoirs    :List of 5
#>   ..$ dim       :List of 6
#>   .. ..$ id      : chr [1:4] "LAC_AUBE" "LAC_MARNE" "LAC_SEINE" "LAC_YONNE"
#>   .. ..$ down    : chr [1:4] "R_AUBE" "R_MARNE" "R_SEINE" "H2021010"
#>   .. ..$ length  : chr [1:4] "3" "3" "18" "3"
#>   .. ..$ vmin    : chr [1:4] "2.300e6" "1.000e7" "6.600e6" "8.500e6"
#>   .. ..$ vmax    : chr [1:4] "1.835e8" "3.645e8" "2.195e8" "8.250e7"
#>   .. ..$ celerity: chr [1:4] "5e-01" "5e-01" "5e-01" "5e-01"
#>   ..$ diversions:List of 3
#>   .. ..$ id    : chr [1:9] "P_AUBE" "P_BLAISE" "P_MARNE" "P_SEINE" ...
#>   .. ..$ down  : chr [1:9] "LAC_AUBE" "LAC_MARNE" "LAC_MARNE" "LAC_SEINE" ...
#>   .. ..$ length: chr [1:9] "5" "5" "12" "13" ...
#>   ..$ threshold :List of 4
#>   .. ..$ id        : chr [1:9] "P_AUBE" "R_AUBE" "P_MARNE" "P_BLAISE" ...
#>   .. ..$ id_lac    : chr [1:9] "LAC_AUBE" "LAC_AUBE" "LAC_MARNE" "LAC_MARNE" ...
#>   .. ..$ QmaxChanel: chr [1:9] "135" "35" "375" "33" ...
#>   .. ..$ QvarMaxDay: chr [1:9] "1e9" "1e9" "1e9" "1e9" ...
#>   ..$ filling   :List of 2
#>   .. ..$ id    : chr [1:3] "AMANCE" "AUZON" "CHAUM_07"
#>   .. ..$ id_lac: chr [1:3] "LAC_AUBE" "LAC_AUBE" "LAC_YONNE"
#>   ..$ resupplies:List of 3
#>   .. ..$ id    : chr [1:4] "DROYES" "NIVERNAIS" "AMANCE" "AUZON"
#>   .. ..$ id_div: chr [1:4] "R_MARNE" "H2021010" "AMANCE" "AUZON"
#>   .. ..$ id_lac: chr [1:4] "LAC_MARNE" "LAC_YONNE" "LAC_AUBE" "LAC_AUBE"
#>  $ calibration   :List of 4
#>   ..$ date :List of 2
#>   .. ..$ start: chr "1959-08-01"
#>   .. ..$ end  : chr "2022-07-31"
#>   ..$ param:List of 1
#>   .. ..$ cemaneige: num [1:2] 0.9 2.3
#>   ..$ eval : logi FALSE
#>   ..$ path : chr "02-calibration"
#>  $ Qnat          :List of 1
#>   ..$ path: chr "03-naturalised_flows"
#>  $ currentrules  :List of 2
#>   ..$ name: chr "Current"
#>   ..$ path: chr "04-current_rules"
#>  $ riskbasedrules:List of 2
#>   ..$ name: chr "Risk based"
#>   ..$ path: chr "05-risk_based_rules"
#>  $ Version       : chr "v2.0"
#>  $ model         : chr "RunModel_CemaNeigeGR4J"
#>  - attr(*, "config")= chr "default"
#>  - attr(*, "file")= chr "/tmp/Rtmpt8qD65/temp_libpath12d2d0c22bf/seinebasin2/config.yml"