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

Update scenario executive summary #315

Merged
merged 8 commits into from
Jun 10, 2024
Merged

Update scenario executive summary #315

merged 8 commits into from
Jun 10, 2024

Conversation

MonikaFu
Copy link
Contributor

@MonikaFu MonikaFu commented May 24, 2024

Updating scenario source and scenario for executive summary calculations. Aligned with what the team decided to use.

@MonikaFu MonikaFu requested review from jdhoffa and cjyetman May 24, 2024 16:08
@MonikaFu
Copy link
Contributor Author

This PR is dependent on: RMI-PACTA/pacta.executive.summary#325 that is why I marked it as 'draft'.

Copy link

github-actions bot commented May 24, 2024

Docker build status

commit_time git_sha project_code holdings_date language peer_group report summary image
2024-06-03T18:17:48Z 309c8d6, GENERAL 2022Q4 EN other Report transitionmonitordockerregistry.azurecr.io/rmi_pacta_2022q4_general:20240603T182555Z
2024-06-03T18:17:48Z 309c8d6, GENERAL 2023Q4 EN other Report transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_general:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 DE bank Report Summary transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 DE other Report transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 EN assetmanager Report Summary transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 EN bank Report Summary transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 EN insurance Report Summary transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 EN other Report transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 EN pensionfund Report Summary transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 FR bank Report Summary transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6, PA2024CH 2023Q4 FR other Report transitionmonitordockerregistry.azurecr.io/rmi_pacta_2023q4_pa2024ch:20240603T182557Z
2024-06-03T18:17:48Z 309c8d6 ghcr.io/rmi-pacta/workflow.transition.monitor:pr315

@cjyetman
Copy link
Member

@MonikaFu RMI-PACTA/pacta.executive.summary#325 has been merged, but this is still in draft mode. Is it ready for review?

@MonikaFu
Copy link
Contributor Author

It's probably best after we also merge this one: RMI-PACTA/pacta.executive.summary#327 (comment). Then we have the right datasets for calculating the scores.

@MonikaFu MonikaFu marked this pull request as ready for review May 30, 2024 14:54
@MonikaFu
Copy link
Contributor Author

It's ready for review now.

jdhoffa
jdhoffa previously approved these changes May 30, 2024
Copy link
Member

@jdhoffa jdhoffa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!
But let's wait then for the CI/CD to run and see what it looks like :-)

@jdhoffa
Copy link
Member

jdhoffa commented May 30, 2024

cjyetman
cjyetman previously approved these changes May 30, 2024
Copy link
Member

@cjyetman cjyetman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems ok to me, but I have no idea how this affects the plots in the exec summary

@jdhoffa
Copy link
Member

jdhoffa commented May 31, 2024

I manually re-triggered Docker build and test off this branch here:
https://github.com/RMI-PACTA/workflow.transition.monitor/actions/runs/9314690620

Wondering if maybe it didn't pick up the latest changes in pacta.executive.summary. I will link the built test ES pdfs here once they are built, but I would suggest that we don't merge this PR until we get the plots we expect.

@MonikaFu
Copy link
Contributor Author

MonikaFu commented May 31, 2024

Agreed @jdhoffa. It seems that the docker build is not always picking up the changes made to other PRs. It happened before.

@cjyetman
Copy link
Member

I manually re-triggered Docker build and test off this branch here: https://github.com/RMI-PACTA/workflow.transition.monitor/actions/runs/9314690620

Wondering if maybe it didn't pick up the latest changes in pacta.executive.summary. I will link the built test ES pdfs here once they are built, but I would suggest that we don't merge this PR until we get the plots we expect.

FYI... usually if a PR is created (technically, if an action runs) before a change in another repo is available on its main branch, re-running the action will not pickup new changes on the other repo... it seems to cache whatever was there the first time the action was run. So, if that situation is relevant here, you may want to open a new PR with the same changes here and see if the action succeeds with that.

@jdhoffa
Copy link
Member

jdhoffa commented May 31, 2024

Thanks @cjyetman good to know!

Test PR here:
#320

@AlexAxthelm
Copy link
Collaborator

I manually re-triggered Docker build and test off this branch here: https://github.com/RMI-PACTA/workflow.transition.monitor/actions/runs/9314690620
Wondering if maybe it didn't pick up the latest changes in pacta.executive.summary. I will link the built test ES pdfs here once they are built, but I would suggest that we don't merge this PR until we get the plots we expect.

FYI... usually if a PR is created (technically, if an action runs) before a change in another repo is available on its main branch, re-running the action will not pickup new changes on the other repo... it seems to cache whatever was there the first time the action was run. So, if that situation is relevant here, you may want to open a new PR with the same changes here and see if the action succeeds with that.

More specificly, the behavior I've observed (but not seen documented anywhere) is For a given run of a workflow, all GH-related state information (such as the HEAD for workflows in the RMI-PACTA/actions repo, or the commit that is checked out with the actions/checkout step) is preserved across attempts ("re-run failed jobs"), but anything external (Azure resources, for example) are still "live".

You can trigger a new "run" (with new caching of state) by pushing a new commit. For example, see this PR (RMI-PACTA/workflow.pacta#59), where I add and delete trivial whitespace in order to explicitly trigger new runs.

@MonikaFu
Copy link
Contributor Author

This is very strange because when I run the PR locally with all the latest versions of packages on main I get the plots showing up.

@AlexAxthelm
Copy link
Collaborator

This is very strange because when I run the PR locally with all the latest versions of packages on main I get the plots showing up.

Are you using the same testing data?

@MonikaFu
Copy link
Contributor Author

This is very strange because when I run the PR locally with all the latest versions of packages on main I get the plots showing up.

Are you using the same testing data?

Now yes I believe and I still get some plots to appear although some do not. But I don't get the same pdf as @jdhoffa with no plots generated.

@MonikaFu
Copy link
Contributor Author

MonikaFu commented May 31, 2024

First thing I discovered is that in the indices data the scenario name we want to be using from WEO2023 is NZE_2050 and not NZE.

@AlexAxthelm @jdhoffa

Please note that the indices files exist in two places, user_results and whatever the directory is that stores indices in the docker file. Until now this did not lead to issues but given that now indices are generated dynamically it might be beneficial to refactor the code of ES to use the same indices as the rest of workflow.transition. monitor.

@AlexAxthelm
Copy link
Collaborator

Until now this did not lead to issues but given that now indices are generated dynamically it might be beneficial to refactor the code of ES to use the same indices as the rest of workflow.transition. monitor.

Do we know why we used different files in the first place? I'm generally in favor of integrating them though.

@jdhoffa
Copy link
Member

jdhoffa commented May 31, 2024

Until now this did not lead to issues but given that now indices are generated dynamically it might be beneficial to refactor the code of ES to use the same indices as the rest of workflow.transition. monitor.

Do we know why we used different files in the first place? I'm generally in favor of integrating them though.

For the record, I did know/ notice that indices files had to be copied into the user_results folder, but I have no idea why they were (e.g. if it was done intentionally, or just a tech debt artifact). @cjyetman do you have any insights there?

@MonikaFu
Copy link
Contributor Author

I'm pretty sure @cjyetman does not have insights here. It is an artifact of ES code. I guess it is easier to access them this way from within the ES template but I'm not sure why the person who wrote this code did not access indices the same way they access pacta results.

@jdhoffa
Copy link
Member

jdhoffa commented May 31, 2024

Are the indices files in the user_data folder even used??
The indices data that is passed to prep_executive_summary in web_tool_3 are the identical data that gets passed to create_interactive_report:

indices_equity_results_portfolio = indices_equity_results_portfolio,
indices_bonds_results_portfolio = indices_bonds_results_portfolio,

indices_equity_results_portfolio = indices_equity_results_portfolio,
indices_bonds_results_portfolio = indices_bonds_results_portfolio,

which are the ones prepared directly by workflow.prepare.pacta.indices:

indices_equity_results_portfolio <- readRDS(file.path(analysis_inputs_path, "Indices_equity_results_portfolio.rds"))
indices_bonds_results_portfolio <- readRDS(file.path(analysis_inputs_path, "Indices_bonds_results_portfolio.rds"))

@MonikaFu can you try removing the indices data from user_data and running web_tool_3 and see if anything fails?

@MonikaFu
Copy link
Contributor Author

@jdhoffa I'm pretty sure I did in the past and it failed.

@MonikaFu
Copy link
Contributor Author

MonikaFu commented Jun 3, 2024

template.pdf

Here what I get locally.

@jdhoffa
Copy link
Member

jdhoffa commented Jun 3, 2024

Just ran it locally with the latest Azure data, and I also get the same "error no plot" issue.
Screenshot 2024-06-03 at 16 27 34

So evidently there is some difference between our local set-ups.

But in any case, I can reproduce the issue that's happening on CI/CD, so will look into it further.

scenario_source = "GECO2023",
scenario_selected = "1.5C",
scenario_source = "WEO2023",
scenario_selected = "NZE",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scenario_selected = "NZE",
scenario_selected = "NZE_2050",

The April 24th run of data prep has this specification for scenario name:
Screenshot 2024-06-03 at 16 42 45

Also in line with what the config file expects:

select_scenario: WEO2023_NZE_2050
scenario_other: WEO2023_NZE_2050

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for future reference, the scenario-source pairs are included in the manifest

jsonlite::read_json("~/Downloads/2023Q4_20240527T092929Z/manifest.json")$parameters$output_stats$source_scenario_pairs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or better...

manifest <- jsonlite::fromJSON("~/Downloads/2023Q4_20240527T092929Z/manifest.json")
manifest$parameters$output_stats$source_scenario_pairs
#>   scenario_source  scenario
#> 1        GECO2023      1.5C
#> 2        GECO2023   NDC-LTS
#> 3        GECO2023 Reference
#> 4         ISF2023     1.5°C
#> 5         WEO2023       APS
#> 6         WEO2023  NZE_2050
#> 7         WEO2023     STEPS

scenario_source = "GECO2023",
scenario_selected = "1.5C",
scenario_source = "WEO2023",
scenario_selected = "NZE",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scenario_selected = "NZE",
scenario_selected = "NZE_2050",

@jdhoffa
Copy link
Member

jdhoffa commented Jun 3, 2024

FYI @MonikaFu I think it still won't work until RMI-PACTA/pacta.executive.summary#330 is merged. From what I remember, parts of the executive summary (unfortunately) still depend on default parameters

@MonikaFu
Copy link
Contributor Author

MonikaFu commented Jun 3, 2024

It depends on the scenario_thresholds dataset I believe so yes, correct, I don't expect it to work without that PR.

@jdhoffa
Copy link
Member

jdhoffa commented Jun 3, 2024

Re-triggered CI/CD, we shall see what happens there.

Indices data has already been updated on Azure user_results, so that should no longer be a problem

@cjyetman
Copy link
Member

cjyetman commented Jun 3, 2024

Re-triggered CI/CD, we shall see what happens there.

Indices data has already been updated on Azure user_results, so that should no longer be a problem

FYI, I think @AlexAxthelm clarified that re-triggering (telling GitHub to re-run) will use cached versions of external repos (therefor, not pick up recent changes to external repos), but adding a new commit to this PR will clear the cache and re-run with most recent version of external repos.

@MonikaFu
Copy link
Contributor Author

MonikaFu commented Jun 3, 2024

@cjyetman just added and removed a line of code, let's see if this works.

@cjyetman
Copy link
Member

cjyetman commented Jun 5, 2024

seems like the plots are still erroring in the results, no?

@MonikaFu
Copy link
Contributor Author

MonikaFu commented Jun 6, 2024

@cjyetman yes, indeed, it looks like it. Looking into it now and trying to add missing pieces with RMI-PACTA/pacta.executive.summary#331.

@MonikaFu
Copy link
Contributor Author

MonikaFu commented Jun 6, 2024

Alright, so I looked into this PR more (locally) and it seems like after merging this fix: RMI-PACTA/pacta.executive.summary#331 most of the plots should show up in the executive summary (with the exception of the scores, 2nd page, bottom). I manually updated the indices locally to match the ones used for this run both in the folder with pacta data and in user_results. If after the fix mentioned above we still don't get any plots to appear my suspicion would be that the issues are partly related to the docker run. I would try to update the user_results with new indices and see if that helps. And maybe we should close this PR and open a new one after the fix in pacta.executive.summary is fixed? Just to be sure.

@cjyetman
Copy link
Member

cjyetman commented Jun 7, 2024

@MonikaFu do you have any idea why things run as expected on your machine but not here? To me, that's a major source of confusion making this very difficult to resolve. I think we should try to get things aligned before committing to various fixes that don't actually work.

@jdhoffa
Copy link
Member

jdhoffa commented Jun 7, 2024

@MonikaFu do you have any idea why things run as expected on your machine but not here? To me, that's a major source of confusion making this very difficult to resolve. I think we should try to get things aligned before committing to various fixes that don't actually work.

My hunch would be that @MonikaFu's local data was out of sync, since locally she was able to produce a report prior to the NZE -> NZE_2050 commits

@jdhoffa
Copy link
Member

jdhoffa commented Jun 10, 2024

@MonikaFu what is the status of this?

@cjyetman
Copy link
Member

Merging this as both PR dependencies have merged and the output on main looks pretty good, and this PR just changes the preferred scenario to use as a comparison in the exec summary. If follow-on changes need to be made, we can do that in a future PR.

@cjyetman cjyetman merged commit 7295944 into main Jun 10, 2024
22 checks passed
@cjyetman cjyetman deleted the update-scenario-es branch June 10, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants