-
Notifications
You must be signed in to change notification settings - Fork 41
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
use explicit gdx_refprices in convGDX2MIF, ignore LDV variables with NA unit #410
Conversation
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.
Thanks Oliver!
If it can be done without breaking anything, I would be in favour of renaming, as it's easier to understand and more consistent with the scenario_config.csv (gdx_ref used for fixing in GAMS and prices, and gdx_ref_policycosts only for the policycosts)
6a98a94
to
e04aade
Compare
Ok, so if |
I now set
|
@@ -5,26 +5,28 @@ | |||
#' | |||
#' | |||
#' @param gdx a GDX as created by readGDX, or the file name of a gdx | |||
#' @param gdx_ref reference-gdx for policy costs, a GDX as created by readGDX, or the file name of a gdx | |||
#' @param gdx_ref reference-gdx for < cm_startyear, used for fixing the prices to this scenario |
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.
there is no gdx_ref
argument anymore
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.
that is not correct, we still need gdx_ref
…
#' @author Lavinia Baumstark | ||
#' @examples | ||
#' | ||
#' \dontrun{convGDX2MIF(gdx,gdx_ref,file="REMIND_generic_default.csv",scenario="default")} | ||
#' \dontrun{convGDX2MIF(gdx,gdx_refpolicycost,file="REMIND_generic_default.csv",scenario="default")} | ||
#' | ||
#' @export | ||
#' @importFrom gdx readGDX | ||
#' @importFrom magclass mbind write.report | ||
|
||
convGDX2MIF <- function(gdx, gdx_ref = NULL, file = NULL, scenario = "default", |
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.
why do we need gdx_ref still for price correction?
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.
Because prices are Moving Averages, and if cm_startyear
= 2025, and then the policy scenario calculates its 2020 price values, this takes into account the 2025 value which differs from its reference scenario, and so the reported prices would differ in 2020 even though they should not. See the long debates in #402
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.
ah, thanks
@@ -691,15 +691,17 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, | |||
out.reporting <- pmax(out, 0) # avoid negative prices | |||
|
|||
# for cm_startyear and non-SSP2, replace price by average of period before and after | |||
# this is a workaround to avoid spikes caused by https://github.com/remindmodel/remind/issues/1068 |
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.
but this it not used in default reporting in REMIND, right?
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.
This is used for all non-SSP2 scenarios at the moment, as long as this remind issue is not fixed. Please discuss that with @soergel.
Sounds good to me. I understand the user workflow for calculating policy costs is still the same after this, right?
|
Yes, that remains unchanged. I thought about renaming the |
For the record: Had a chat with @Renato-Rodrigues, he is fine with the changes in reportPrices. |
gdx_ref
togdx_refpolicycosts
in order to be consistent, but I'm a bit afraid of breaking stuff… @LaviniaBaumstark / @Renato-Rodrigues, would you prefer that?NA
in some LDV units (see variables with unit NA #408), as suggested by @robertpietzckerfegat
to fix reportPrices reports NA for fegat in transport #405""
, but withNULL