RMI-PACTA / pacta.scenario.data.preparation

The goal of {pacta.scenario.data.preparation} is to prepare and format all scenario input datasets required to run the {pacta.portfolio.allocate} tool.
https://rmi-pacta.github.io/pacta.scenario.data.preparation/
Other
1 stars 0 forks source link

add `prepare_isf_2023_scenario()` #25

Closed cjyetman closed 5 months ago

cjyetman commented 5 months ago

The iso_2023 object prepared here has some differences with the pacta.scenario.preparation::iso_2023 object, but I have confirmed with @Antoine-Lalechere that they are probably desirable:

the following code finds no differences

waldo::compare(
  dplyr::filter(
    dplyr::arrange(pacta.scenario.preparation::isf_2023, scenario, scenario_geography, sector, technology),
    !sector %in% c("Oil&Gas", "Coal")
  ),
  dplyr::filter(
    dplyr::mutate(
      dplyr::arrange(isf_2023, scenario, scenario_geography, sector, technology),
      scenario_geography = dplyr::case_when(
        scenario_geography == "Saudi Arabia" ~ "Saudi_Arabia",
        scenario_geography == "South Africa" ~ "South_Africa",
        scenario_geography == "South Korea" ~ "South_Korea",
        scenario_geography == "US" ~ "USA",
        .default = scenario_geography
      )
    ),
    !sector %in% c("Oil&Gas", "Coal")
  ),
  tolerance = 1e-15
)