Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Remove scaffolding added via #356 (#360)
Browse files Browse the repository at this point in the history
Closes #359

This reverts a bunch of commits (with minor changes) to remove scaffolding added via #356.
  • Loading branch information
maurolepore authored Dec 11, 2020
1 parent 55e4950 commit ff4177e
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions web_tool_script_3.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,10 @@ js_translations <- jsonlite::fromJSON(
txt = path(template_path, "data/translation/js_labels.json")
)

sector_order <- function(path) {
# TODO: Remove following create_interactive_report#313
if (!fs::file_exists(path)) {
rlang::warn(glue::glue(
"This file doesn't exit: {path}.
Have you already merged create_interactive_report#313?"
))
return(NULL)
}

readr::read_csv(
path(template_path, "data", "sector_order", "sector_order.csv"),
col_types = cols()
)
}
sector_order <- readr::read_csv(
path(template_path, "data","sector_order","sector_order.csv"),
col_types = cols()
)

# Needed for testing only
shock <- shock_year # this should come directly from the stress test.. 2030 based on current discussions in CHPA2020 case
Expand All @@ -198,7 +187,7 @@ twodi_sectors = sector_list
repo_path = template_path
file_name = "template.Rmd"

arguments <- list(
create_interactive_report(
repo_path = template_path,
template_dir = template_dir,
output_dir = output_dir,
Expand Down Expand Up @@ -244,15 +233,10 @@ arguments <- list(
ipr_results_stress_test = ipr_results_stress_test,
display_currency = display_currency,
currency_exchange_value = currency_exchange_value,
header_dictionary = header_dictionary
header_dictionary = header_dictionary,
sector_order = sector_order
)

has_arg <- utils::hasName(formals(create_executive_summary), "sector_order")
if (has_arg) {
arg <- list(sector_order = sector_order())
arguments <- append(arguments, arg)
}
purrr::invoke(create_interactive_report, arguments)

create_executive_summary(
file_name = "template.Rmd",
Expand Down

0 comments on commit ff4177e

Please sign in to comment.