diff --git a/tests/testthat/test-calculate_company_alignment_metric.R b/tests/testthat/test-calculate_company_alignment_metric.R index fa82987f..09147263 100644 --- a/tests/testthat/test-calculate_company_alignment_metric.R +++ b/tests/testthat/test-calculate_company_alignment_metric.R @@ -65,14 +65,12 @@ test_data_remove_tech_no_plans_no_target_4 <- tibble::tribble( "automotive", "ice", 2027, "global", "scenario_source", "test_company", 75, 60 ) # 5) NAs in projected and target values -# TODO: reconsider if this needs to be handled somewhere else, effectively NAs are treated like zero test_data_remove_tech_no_plans_no_target_5 <- tibble::tribble( ~sector, ~technology, ~year, ~region, ~scenario_source, ~name_abcd, ~projected, ~target_scenario, "automotive", "electric", 2027, "global", "scenario_source", "test_company", NA_real_, NA_real_, "automotive", "ice", 2027, "global", "scenario_source", "test_company", NA_real_, NA_real_ ) # 6) NA in one of projected and target values -# TODO: reconsider if this needs to be handled somewhere else, effectively NAs are treated like zero test_data_remove_tech_no_plans_no_target_6 <- tibble::tribble( ~sector, ~technology, ~year, ~region, ~scenario_source, ~name_abcd, ~projected, ~target_scenario, "automotive", "electric", 2027, "global", "scenario_source", "test_company", NA_real_, NA_real_, @@ -135,7 +133,6 @@ test_data_remove_sector_no_target_3 <- tibble::tribble( "automotive", "ice", 2027, "global", "scenario_source", "test_company", 0, 5 ) # 4) NA values in all target values of sector -# TODO: reconsider if this needs to be handled somewhere else, effectively NAs are treated like zero test_data_remove_sector_no_target_4 <- tibble::tribble( ~sector, ~technology, ~year, ~region, ~scenario_source, ~name_abcd, ~projected, ~target_scenario, "automotive", "electric", 2027, "global", "scenario_source", "test_company", 25, NA_real_, @@ -258,7 +255,6 @@ test_that("total_tech_deviation is less or equal 0 for all technologies in bridg # calculate_company_aggregate_alignment_tms---- # styler: off -# TODO: add a case of a pure phaseout sector test_data_calculate_company_aggregate_alignment_tms <- tibble::tribble( ~sector, ~technology, ~year, ~region, ~scenario_source, ~name_abcd, ~projected, ~target_scenario, ~direction, ~total_tech_deviation, ~activity_unit, "power", "gascap", 2027, "global", "test_source", "test_company", 100, 80, "phaseout", -20, "MW", @@ -286,7 +282,6 @@ test_output_calculate_company_aggregate_alignment_tms_2 <- calculate_company_agg level = test_level_bo_po ) -# TODO: add expectations for the actual output values test_that("calculate_company_aggregate_alignment_tms returns expected directions", { expect_equal(sort(unique(test_output_calculate_company_aggregate_alignment_tms_1$direction)), c("net")) expect_equal(sort(unique(test_output_calculate_company_aggregate_alignment_tms_2$direction)), c("buildout", "phaseout")) diff --git a/vignettes/cookbook_running_the_analysis.Rmd b/vignettes/cookbook_running_the_analysis.Rmd index 67c6ac39..bd7f7ee7 100644 --- a/vignettes/cookbook_running_the_analysis.Rmd +++ b/vignettes/cookbook_running_the_analysis.Rmd @@ -176,7 +176,6 @@ The `analysis()` function has a number of options that can be set in the `config - the start year of the analysis. This must be a year that is available both in the ABCD data and for which the scenario data has been prepared. The loan book data is assumed to be a snapshot of the end of the same year. - the time frame of the analysis, which refers to the number of forward looking years after the start year that are to be considered in the alignment analysis. Usually this time frame is set to 5 years. Specifically, it must be a time frame for which scenario data values and ABCD data values are available for all sectors that are to be analyzed. There are not many cases, in which it is expected to change the time frame to something else than its default value of 5 years. - by which variables to group the loan books to produce grouped results of the analysis. This parameter is used across multiple steps of the analysis, both in the diagnostics and in the analysis. This is because it slices and/or aggregates the loan books such that the analysis will produce results along the indicated dimension. If no `by_group` parameter is passed (i.e. `NULL`), all loan books will be aggregated. Otherwise, loan books can either be kept separate (`group_id`) or grouped by any other variable that is provided in each of the raw loan books. - All these options are documented in more detail the [section on project parameters](https://rmi-pacta.github.io/pacta.multi.loanbook/articles/config_yml.html#project_parameters) in the `vignette("config_yml")`.