-
Notifications
You must be signed in to change notification settings - Fork 47
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
refactor calcFEdemand #458
Conversation
63907ff
to
17643ef
Compare
afe593d
to
6e767cb
Compare
And, is there? |
No, there are no unexpected differences in input data, other than the ones I listed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moin! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bs538, are you OK with killing ODYM_RECC
? It was not used in the end, right?
No, it wasn't used in the version for the final scenario runs. But the SHAPE papers are only about to be submitted, so if possible without major trouble I'd be in favour of keeping it in case we need to make modifications during the review. |
What's the general feeling about passing that information along via |
@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q @mellamoSimon Concerning "fake scenarios": thanks for pointing this out, Michaja. Indeed, there is potential for simplifying the code and I will do so. Simón, for this PR my goal is to not change input data if possible. So in the end the scenarios will still be in the files generated as part of this PR. Will check together with the rest of RSE if we can get rid of some of it (maybe as part of a larger refactoring in REMIND) as a next step. I will add further changes to this PR that postpone the generation of fake scenarios to the latest possible point, so that industry and transport no longer have to deal with it in the respective calcFEdemand functions, as it will only be done in calcFEDemand in the very end. |
Haven't thought about it yet. What kind of info would you like to pass via setConfig? |
|
Isn't that information we can share with a mapping? Seems a bit cleaner to me than introducing a new key in the madrat configuration. |
Kinda weird to read a file over and over again for the same bit of information. But than again, what's not weird with |
Had a closer look, and unfortunately there is not much potential to simplify the code here (although I would have loved to get rid of some of it) The assumption for this PR is that all these duplicate scenarios must still be present in the generated inputdata files for REMIND, using the same file structure. (If this was not the case, we could further simplify the code, but this should be done in a separate PR) Why can't we get rid of it?
Also, I would like to highlight that this duplication has always been there, it was not introduced by this PR. If we agreed on generating separate feDemand files for industry, transport and buildings that are read in individually by the respective modules in REMIND, we could definitely simplify the code and get rid of the fake scenarios. But this sth we would have to agree on collectively and implement separately (and it includes a potentially complex (?) refactoring on REMIND side). |
Why would I want to change the config? From my understanding, inputdata generation always generates all the possible scenario data any REMIND run would want to use, no? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robertpietzcker I think this is only needed for complex - I will double check, but I think it can be deleted completely. Do you remember anything regarding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI there is a separate follow-up draft PR where we remove code related to transport
#468
Purpose:
Split up code in
calcFEdemand
by sectors, so that sector experts can adjust input data generation for their sector without messing with other sectors by accident.Implementation Details
calcFEdemand
is moved tocalcFeDemandBuildings
,calcFeDemandIndustry
andcalcFeDemandBuildings
.ES
,EsUeFe_in
,EsUeFe_out
,UE_for_Eff
,FE_for_Eff
FE
FE_buildings
,UE_buildings
were migrated tocalcFeDemandBuildings
, as they only produce EDGE buildings dataRemoved subtypes from calcFEdemand
ES
, in consequence removedf29_esdemand.cs4r
EsUeFe_in
,EsUeFe_out
, in consequence removedp36_serviceInputs.cs4r
,p36_serviceOutputs.cs4r
UE_for_Eff
,FE_for_Eff
, in consequence removedcalcEnergyEffPaths
, which creates output filef29_efficiency_growth.cs4
Refactoring of EDGE Buildings functions
readEDGE
,convertEDGE
toreadEdgeBuildings
andconvertEdgeBuildings
readEDGE
(subtypeFE_stationary
), as this is read in from a different source than EDGE BuildingsreadEDGE
:Capital
,CapitalUnit
,ES_buildings
readEDGE
:FE_buildings
->FE
CapitalUnit
fromcalcCapital
, as it is no longer needed in it's only calling functionreadEDGE
-> thereforecalcCapital
no longer needs subtypes and former subtypeCapital
corresponds to current code; filef29_capitalUnitProjections.cs45
is no longer generatedcalcCapital
, as it is no longer used. in consequence,f29_capitalQuantity.cs4r
now has less variables, but one additional year (see below for details)Depends on
remindmodel/remind#1509
Tests and Validation
f29_capitalUnitProjections.cs4r
,f29_efficiency_growth.cs4r
,f29_esdemand.cs4r
,p36_serviceInputs.cs4r
,p36_serviceOutputs.cs4r
f29_capitalQuantity.cs4r
,f_fedemand.cs4r
(see below)differences in f_fedemand.cs4r
ueHDVt
andueLDVt
for Low Energy, Campaigners and Navigate Scenarios due to a bugfix in this linedifferences in f29_capitalQuantity.cs4r