-
Notifications
You must be signed in to change notification settings - Fork 154
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
Correct MACRO GDP reporting & update docs #430
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #430 +/- ##
=====================================
Coverage 95.4% 95.4%
=====================================
Files 46 46
Lines 4354 4354
=====================================
Hits 4156 4156
Misses 198 198 |
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 @GamzeUnlu95 for drafting this correction. In my view, this is an enhancement; just a few points before merging:
- I suggested some minor edits in the GAMS files as inline comments
- More importantly, can you develop a test that show this correction. For example, a test that asserts that the calculated GDP should be equal to a certain value?
- I believe after applying these changes, some overnight tests may not pass because the objective value may change. I can't see that at the moment as the PR needs to be rebased and the tests should be run again.
Overall, nice contribution.
952808c
to
425773b
Compare
Hi @GamzeUnlu95 - I understand there are still some requirements left for this to be merged. Would you say it is available to try to use on a trial basis? |
Hi folks, I wanted to report back after having tried to use this PR in some of my ongoing work. Observed issue: Running a mitigation scenario with a calibrated scenario causes MESSAGE LP infeasibility within MESSAGE-MACRO iteration. Suggestion: Before merging this, run a test case on the current ENGAGE set up where MACRO is recalibrated with these changes and confirm that mitigation cases can still converge. More specifics: It's hard for me to pin point exactly why this PR causes my failure, but I am combining a number of updates - I start from the new R15 model, apply 1-year time steps for early periods, and calibrate using this MACRO branch. I did not observe any issues while creating baselines or non-mitigation scenarios. When I reverted back to current |
Can you please upload a snippet from the GAMS .lst file to indicate which variables are infeasible? |
That file has already been overwritten. I can try later to reproduce - can you tell me what to |
But this is a good opportunity to plug our need for better tooling when dealing with infeasibilities. It would be great to have some first (or even second) class support to say, dump out why a model was infeasible at the end of a run that is persistable. |
#418 (comment) for example |
425773b
to
6c8f667
Compare
I have pulled these changes onto the latest main branch, updated the macro-calibration xlsx but then encountered errors.
Has anyone encountered such issues? Was this PR already tested with the calibration? I have added the macro_run.lst file as a .txt file if this helps with debugging. |
Thanks for adding the .lst file. I attempted to test this PR with calibration a couple of months ago and at that time there was an issue with the macro-calibration xlsx in the main branch and I could not complete it. I need to find and allocate time soon to test this PR again and finalize it. |
6c8f667
to
8d76577
Compare
I tested this PR with the ENGAGE setup by using the model
|
8d76577
to
53c59a7
Compare
At today's message meeting, this PR was suggested to me as a possible fix for #752. As far as I can tell, this PR does not enable usage of user-defined units. However, I rebased this onto current main so if you want to run any tests again to see if this can be merged, this might be a good time, @GamzeUnlu95, @OFR-IIASA, @gidden. |
53c59a7
to
5dfd483
Compare
This PR may even predate the PR template, but it is missing one item that appears there: "Update release notes". I've added this to the PR description above. These notes are especially important when the behaviour and outputs of the core GAMS code change, as in this PR. Users must have an opportunity to notice and understand how their model outputs may be affected by a new release. |
As discussed in yesterday's weekly meeting, we hold off on merging these changes because we don't trust our current test suite to adequately verify that the changes won't break anything. As @gidden suggested (please correct me if I misunderstood), we should set up a testing workflow that runs a full emission baseline and a peak budget scenario. Since these runs might take a while, we would ideally keep them optional and either run them as part of nightly tests or enable them on PRs that affect the GAMS code. This would allow us to trust the changes here. @Jihoon noted that the line currently causing the test failure reported by @GamzeUnlu95 had caused issues before, so was removed locally in his installation without any noticeable negative consequences. No one else in the room knew what this line might be good for, so in a separate PR, we could try to remove it -- and test that with the new test cases proposed above. |
Thanks @glatterf42. My suggestion is to follow @khaeru's example here and combine this with @OFR-IIASA's ENGAGE process script here. I would suggest to run
And compare a few key metrics on the output excel (e.g., co2 emissions, kyoto emissions, gdp, primary energy, final energy). |
While I generally agree with this idea directionally and the basic observation underlying it, to implement these ideas would involve, conservatively, at least 2 person-weeks of work. Either we accept that this PR sits until someone is assigned/freed-up to spend that time, or we find a simpler, manual check (and someone to do it) that can assure that this PR will not change [expected behaviour]. In order to avoid derailing this particular PR with that broader discussion, I'll open a new issue. |
This PR:
Corrects the reporting of GDP which includes the deduction of
trade_costs
coming from MESSAGE.Updates MESSAGEix based total_cost parameter in iteration with MACRO including the trade balance.
Extends the documentation of the capital constraint section in MACRO to explain the reasoning behind the changes.
PR #422 can be closed after merging this.