Skip to content

Commit

Permalink
add timestamp specific GENERAL configs (#287)
Browse files Browse the repository at this point in the history
close #284
supercedes #285 

This PR does two things:

1. replaces `parameter_files/ProjectParameters_GENERAL.yml` with a
unique config file for each timestamp used with `GENERAL`, in the form
`parameter_files/ProjectParameters_GENERAL_{TIMESTAMP}.yml`
2. adds code to each web_tool_script to choose the proper config
filename, for `GENERAL` only, by combining the initiative
(`project_code`) and the timestamp (`port_holdings_date`) (targeting the
new unique config files added here)

The new config files are based on:
- `2019Q4` and `2020Q4`: based on the config file in the
`2dii_pacta:0.3.5` Docker file currently used on PROD on TM for those
timestamps
- `2021Q4`: based on the config file in the
`transitionmonitordockerregistry.azurecr.io/rmi_pacta:2021q4_1.0.0`
Docker file currently used on PROD on TM for that timestamp
- `2022Q4` and `2023Q4`: based on the config file
[ProjectParameters_PA2024CH.yml](https://github.com/RMI-PACTA/workflow.transition.monitor/blob/main/parameter_files/ProjectParameters_PA2024CH.yml)
currently being used for `PA2022CH` (but appropriately modified for the
timestamp)

---------

Co-authored-by: CJ Yetman - RMI <cjrmi@CJs-MacBook-Pro.fritz.box>
  • Loading branch information
cjyetman and CJ Yetman - RMI authored Mar 22, 2024
1 parent b7ed31a commit 6bc7fcd
Show file tree
Hide file tree
Showing 8 changed files with 326 additions and 12 deletions.
86 changes: 86 additions & 0 deletions parameter_files/ProjectParameters_GENERAL_2019Q4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
default:

reporting:
project_report_name: general
display_currency: USD
currency_exchange_value: 1

parameters:
horizon_year: 5
select_scenario: WEO2019_SDS
scenario_auto: ETP2017_B2DS
scenario_other: ETP2017_B2DS
scenario_shipping: ETP2017_B2DS
portfolio_allocation_method: portfolio_weight
scenario_geography: Global

methodology:
has_map: yes
has_sb: no
has_revenue: no
has_credit: no
inc_emissionfactors: yes
inc_stresstest: yes

sectors:
tech_roadmap_sectors:
- Power
- Automotive
- Oil&Gas
- Coal
pacta_sectors_not_analysed:
- Steel
- Aviation
- Cement
green_techs:
- RenewablesCap
- HydroCap
- NuclearCap
- Hybrid
- Electric
- FuelCell
- Hybrid_HDV
- Electric_HDV
- FuelCell_HDV
- Dc-Electric Arc Furnace
- Ac-Electric Arc Furnace
alignment_techs:
- RenewablesCap
- CoalCap
- Coal
- Oil
- Gas
- Electric
- ICE

stress_test:
shock_year: 2030
price_data_version: 2021Q1

asset_types:
- Equity
- Bonds
- Others
- Funds

scenario_sources_list:
- ETP2017
- WEO2019
- WEO2020
- GECO2019
- IPR2021

scenario_geography_list:
- Global
- GlobalAggregate
- NonOECD
- OECD

equity_market_list:
- GlobalMarket
- DevelopedMarket
- EmergingMarket

grouping_variables:
- investor_name
- portfolio_name
86 changes: 86 additions & 0 deletions parameter_files/ProjectParameters_GENERAL_2020Q4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
default:

reporting:
project_report_name: general
display_currency: USD
currency_exchange_value: 1

parameters:
horizon_year: 5
select_scenario: WEO2019_SDS
scenario_auto: ETP2017_B2DS
scenario_other: ETP2017_B2DS
scenario_shipping: ETP2017_B2DS
portfolio_allocation_method: portfolio_weight
scenario_geography: Global

methodology:
has_map: yes
has_sb: no
has_revenue: no
has_credit: no
inc_emissionfactors: yes
inc_stresstest: yes

sectors:
tech_roadmap_sectors:
- Power
- Automotive
- Oil&Gas
- Coal
pacta_sectors_not_analysed:
- Steel
- Aviation
- Cement
green_techs:
- RenewablesCap
- HydroCap
- NuclearCap
- Hybrid
- Electric
- FuelCell
- Hybrid_HDV
- Electric_HDV
- FuelCell_HDV
- Dc-Electric Arc Furnace
- Ac-Electric Arc Furnace
alignment_techs:
- RenewablesCap
- CoalCap
- Coal
- Oil
- Gas
- Electric
- ICE

stress_test:
shock_year: 2030
price_data_version: 2021Q1

asset_types:
- Equity
- Bonds
- Others
- Funds

scenario_sources_list:
- ETP2017
- WEO2019
- WEO2020
- GECO2019
- IPR2021

scenario_geography_list:
- Global
- GlobalAggregate
- NonOECD
- OECD

equity_market_list:
- GlobalMarket
- DevelopedMarket
- EmergingMarket

grouping_variables:
- investor_name
- portfolio_name
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
default:

paths:
data_location_ext: ../pacta-data/2021Q4/

reporting:
project_report_name: general
display_currency: USD
currency_exchange_value: 1

parameters:
timestamp: 2022Q4
dataprep_timestamp: 2022Q4
start_year: 2022
timestamp: 2021Q4
dataprep_timestamp: 2021Q4
start_year: 2021
horizon_year: 5
select_scenario: WEO2022_NZE_2050
scenario_other: GECO2022_1.5C
select_scenario: WEO2021_NZE_2050
scenario_other: GECO2021_1.5C-Unif
portfolio_allocation_method: portfolio_weight
scenario_geography: Global

Expand Down Expand Up @@ -55,10 +58,11 @@ default:
- Funds

scenario_sources_list:
- GECO2022
- IPR2021
- ETP2020
- WEO2021
- GECO2021
- ISF2021
- WEO2022
- IPR2021

scenario_geography_list:
- Global
Expand All @@ -70,3 +74,7 @@ default:
- GlobalMarket
- DevelopedMarket
- EmergingMarket

grouping_variables:
- investor_name
- portfolio_name
58 changes: 58 additions & 0 deletions parameter_files/ProjectParameters_GENERAL_2022Q4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
default:

paths:
data_location_ext: ../pacta-data/2022Q4/

reporting:
project_report_name: general
display_currency: USD
currency_exchange_value: 1

parameters:
start_year: 2022
horizon_year: 5
select_scenario: WEO2022_NZE_2050
scenario_other: GECO2022_1.5C
portfolio_allocation_method: portfolio_weight
scenario_geography: Global

methodology:
has_map: TRUE
has_revenue: FALSE
has_credit: FALSE
inc_emissionfactors: TRUE

sectors:
tech_roadmap_sectors:
- Power
- Automotive
- Oil&Gas
- Coal
pacta_sectors_not_analysed:
- Steel
- Aviation
- Cement
green_techs:
- RenewablesCap
- HydroCap
- NuclearCap
- Hybrid
- Electric
- FuelCell
- Electric Arc Furnace

scenario_sources_list:
- GECO2022
- ISF2021
- WEO2022

scenario_geography_list:
- Global
- GlobalAggregate
- NonOECD
- OECD

equity_market_list:
- GlobalMarket
- DevelopedMarket
- EmergingMarket
58 changes: 58 additions & 0 deletions parameter_files/ProjectParameters_GENERAL_2023Q4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
default:

paths:
data_location_ext: ../pacta-data/2023Q4/

reporting:
project_report_name: general
display_currency: USD
currency_exchange_value: 1

parameters:
start_year: 2023
horizon_year: 5
select_scenario: WEO2023_NZE_2050
scenario_other: WEO2023_NZE_2050
portfolio_allocation_method: portfolio_weight
scenario_geography: Global

methodology:
has_map: TRUE
has_revenue: FALSE
has_credit: FALSE
inc_emissionfactors: TRUE

sectors:
tech_roadmap_sectors:
- Power
- Automotive
- Oil&Gas
- Coal
pacta_sectors_not_analysed:
- Steel
- Aviation
- Cement
green_techs:
- RenewablesCap
- HydroCap
- NuclearCap
- Hybrid
- Electric
- FuelCell
- Electric Arc Furnace

scenario_sources_list:
- GECO2023
- ISF2023
- WEO2023

scenario_geography_list:
- Global
- GlobalAggregate
- NonOECD
- OECD

equity_market_list:
- GlobalMarket
- DevelopedMarket
- EmergingMarket
8 changes: 7 additions & 1 deletion web_tool_script_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ set_webtool_paths(portfolio_root_dir)

set_portfolio_parameters(file_path = file.path(par_file_path, paste0(portfolio_name_ref_all, "_PortfolioParameters.yml")))

set_project_parameters(file.path(working_location, "parameter_files", paste0("ProjectParameters_", project_code, ".yml")))
proj_param_filename <- ifelse(
project_code == "GENERAL",
paste0("ProjectParameters_", project_code, "_", port_holdings_date, ".yml"),
proj_param_filename <- paste0("ProjectParameters_", project_code, ".yml")
)
project_config_path <- file.path(working_location, "parameter_files", proj_param_filename)
set_project_parameters(project_config_path)

# need to define an alternative location for data files
analysis_inputs_path <- set_analysis_inputs_path(data_location_ext)
Expand Down
8 changes: 7 additions & 1 deletion web_tool_script_2.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ set_webtool_paths(portfolio_root_dir)

set_portfolio_parameters(file_path = file.path(par_file_path, paste0(portfolio_name_ref_all, "_PortfolioParameters.yml")))

set_project_parameters(file.path(working_location, "parameter_files", paste0("ProjectParameters_", project_code, ".yml")))
proj_param_filename <- ifelse(
project_code == "GENERAL",
paste0("ProjectParameters_", project_code, "_", port_holdings_date, ".yml"),
proj_param_filename <- paste0("ProjectParameters_", project_code, ".yml")
)
project_config_path <- file.path(working_location, "parameter_files", proj_param_filename)
set_project_parameters(project_config_path)

# need to define an alternative location for data files
analysis_inputs_path <- set_analysis_inputs_path(data_location_ext)
Expand Down
10 changes: 8 additions & 2 deletions web_tool_script_3.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ set_webtool_paths(portfolio_root_dir)

set_portfolio_parameters(file_path = file.path(par_file_path, paste0(portfolio_name_ref_all, "_PortfolioParameters.yml")))

set_project_parameters(file.path(working_location, "parameter_files", paste0("ProjectParameters_", project_code, ".yml")))
proj_param_filename <- ifelse(
project_code == "GENERAL",
paste0("ProjectParameters_", project_code, "_", port_holdings_date, ".yml"),
proj_param_filename <- paste0("ProjectParameters_", project_code, ".yml")
)
project_config_path <- file.path(working_location, "parameter_files", proj_param_filename)
set_project_parameters(project_config_path)

analysis_inputs_path <- set_analysis_inputs_path(data_location_ext)

Expand Down Expand Up @@ -183,7 +189,7 @@ sector_order <- readr::read_csv(

# combine config files to send to create_interactive_report()
portfolio_config_path <- file.path(par_file_path, paste0(portfolio_name_ref_all, "_PortfolioParameters.yml"))
project_config_path <- file.path(working_location, "parameter_files", paste0("ProjectParameters_", project_code, ".yml"))

pacta_data_public_manifest <-
list(
creation_time_date = jsonlite::read_json(file.path(analysis_inputs_path, "manifest.json"))$creation_time_date,
Expand Down

0 comments on commit 6bc7fcd

Please sign in to comment.