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

Implement explicit scenario choice across package. #29

Closed
wants to merge 2 commits into from

Conversation

johanneskoch94
Copy link
Member

@johanneskoch94 johanneskoch94 commented Feb 18, 2025

  • Introduce a scenario argument to calcFeDemandIndustry, calcIndustry_EEK and calcIndustry_Value_Added. The larger picture is the attempt to step away from a default set of scenarios. The choice of scenarios should be explicit. In the case of the input data pipeline, it is made in fullREMIND and then passed on to the different calcOutput functions. Hopefully this will help us control/drop/introduce new scenarios more easily in the future.
  • Add placeholder assumptions in inst data for the SSP2IndiaDEA scenarios.
  • Move SSP2_NAV_all duplication over from mrremind.
  • Remove naming argument in mrdrivers functions.
  • Delete convertUSGS, fixes Remove getConfig() call from convertUSGS() #14.
  • General refactoring. (I apologize for the many seemingly haphazard refactoring changes (making the revision tedious, I know). I just refactor code I come across while I'm debugging, but I don't necessarily refactor the entire function (they're just too large sometimes)).

!! Still waiting for my input data test to run through (/p/tmp/jokoch/pre-processing, output at /p/projects/rd3mod/inputdata/output_1.27/rev7.22johannes_test7_62eff8f7_remind) but tagged in the reviewers so that the revision can start.

Connected to this PR in mrremind.

@johanneskoch94 johanneskoch94 force-pushed the main branch 2 times, most recently from 9b05321 to bfddd91 Compare February 19, 2025 15:04
Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering what the benefit of the "switchboard - with - functions" implementation is, vs a switch implementation, as done here? Is there some mechanic I'm overlooking, or is it simply a design choice? If so, what do you think of using switch instead?

@johanneskoch94 johanneskoch94 changed the title Add a scenario argument to calcFeDemandIndustry and add IndiaDEA scenarios Implement explicit scenario choice across package. Feb 19, 2025
Introduce a scenario argument to calcFeDemandIndustry, calcIndustry_EEK and calcIndustry_Value_Added. The larger picture is the attempt to step away from a default set of scenarios. The choice of scenarios should be explicit. In the case of the input data pipeline, it is made in fullREMIND and then passed on to the different calcOutput functions. Hopefully this will help us control/drop/introduce new scenarios more easily in the future.
Add placeholder assumptions in inst data for the SSP2IndiaDEA scenarios.
Move SSP2_NAV_all duplication over from mrremind.
Remove naming argument in mrdrivers functions.
Delete convertUSGS, fixes pik-piam#14.
General refactoring.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is just a placeholder - but I'm not at all sure if this is the right place to even set up placeholder assumptions for new scenarios.

Comment on lines +1375 to +1377
if ("SSP2_NAV_all" %in% scenario) {
remind <- mbind(remind, setItems(remind[, , "SSP2"], 3.1, "SSP2_NAV_all"))
}
Copy link
Member Author

@johanneskoch94 johanneskoch94 Feb 19, 2025

Choose a reason for hiding this comment

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

A better solution for the SSP2_NAV_all scenario should be implemented at some point, but I couldn't figure out where to do it. (I copied this over from mrremind).

Comment on lines +34 to +37
remind_scenarios <- c(
paste0("SSP", c(1:5, "2_lowEn", "2_highDemDEU", "2IndiaHigh", "2IndiaMedium")),
paste0("SDP", c("", "_EI", "_RC", "_MC"))
)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not ideal, but it's the best I could manage. Ideally we would use the scenario argument directly, but I did not manage to get the function to work, if not all the scenarios are included. If someone else could take over, that would be amazing! For now, the function computes the demand for all the scenarios in remind_scenarios, and then filters to match the scenarios in scenario at the end.

@johanneskoch94 johanneskoch94 marked this pull request as ready for review February 19, 2025 16:14
@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

I am not going to review, or approve, a pull request where you modify swathes code that do not impinge on the things you need to modify in any way, because you need to scratch some itch of yours.

@johanneskoch94
Copy link
Member Author

Yeah, I was afraid of this. I'll set up a new PR and remove the refactoring.

@JakobBD
Copy link
Contributor

JakobBD commented Feb 20, 2025

Regarding convertUSGS, it might still be needed by @bennet21.
I'm sure there's a different way to retrieve a country list in convert functions? Seems like a standard issue?

@johanneskoch94
Copy link
Member Author

Clean version of most important changes here: #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.

Remove getConfig() call from convertUSGS()
3 participants