Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace TODOs with issues #284

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions tests/testthat/test-calculate_company_alignment_metric.R
Original file line number Diff line number Diff line change
Expand Up @@ -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_,
Expand Down Expand Up @@ -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_,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"))
Expand Down
1 change: 0 additions & 1 deletion vignettes/cookbook_running_the_analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<!---TODO: maybe some of the project_parameters should be in the config section analysis, if thei are not used in other parts of the workflow--->

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")`.

Expand Down
Loading