-
Notifications
You must be signed in to change notification settings - Fork 42
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
Drop Backwards Compatibility #524
Comments
I agree that we should reduce the number of gdx files, but I am convinced that the check that remind2 generates the variables the project mappings expect is very useful. They only take seconds, once the mif data is there. My suggestion would be to go from 6 to 2 gdx files:
That should cover everything that these tests are intended for, while reducing runtime by ~2/3. |
I am not sure I fully understand what exactly you want to get rid of, Michaja. But in general, I agree that there is potential. Just a few quick thoughts that come to my mind:
|
tagging @Renato-Rodrigues, as he was one of the driving forces behind introducing the project-specific reporting validation |
thank you for this effort! |
That would fall under what I termed "define a set of module realisations that have to be supported" and we should test for that, if indeed it is the case. I updated the original text to reflect that. |
Probably we should go and find out what those differences are. In general, I am fine with supporting things that are in the current REMIND code. I just do not see any point in keeping post-processing code around for REMIND code that has long since been removed, especially when people can use |
You have to differentiate. The projects are over, so you need not run tests based on a gdx from these projects anymore. But: The mapping templates produced in these projects (saved in piamInterfaces) are still in use. For example the newly started ELEVATE project uses the NAVIGATE template, which serves also as a basis for the new community template (in preparation for AR7). AR6 will be used for NGFS September 2024 release. That is why we should continue running these tests on the templates. ELEVATE + NGFS configs are close enough to our AMT H12 runs, so it is fine to just use these gdx files. |
For SHAPE: indeed the project is officially done, but the papers are only in the making, so while they are in review and until the final scenario DB is published (guessing in around 6 months), there is still the chance that we need to run either additional scenarios, or that we need to fix reporting issues in the current scenarios. Guessing it will be similar for other projects. |
I would be in favor of a reduction of the gdxs tested, but I am not 100% with the option of removing them entirely. This feature was NOT created originally to keep backwards compatibility. The intention was to make sure, whenever somebody commits a reporting change and only test their changes to their personal module and regional configuration, that they don't break the report for other combinations. Before, it was very common that somebody only worked with for example H12 default REMIND modules and committed changes to the reporting library that break the reporting for EU21 regions, or for other commonly used module realisations, e.g. NDC, NPi, regipol, ... My suggestion is to, therefore keep at least two gdxs active, both reflecting AMT policy scenarios, one using the H12 regions configuration and one using the EU21. |
My two cents on that. 1.) I am generally in favor of de-cluttering the if-clauses in the reporting and not keeping backwards compatibility forever. However, I do think it can be useful to use such if-clauses in the development / merge phase precisely because significant REMIND developments often require reporting library changes and it provides more safety and stability after the merge and avoids people having to try to find the right combinations of REMIND and reporting library version that still work together. 2.)
Well, I introduced that in Ariadne and I would say that is not causing trouble per se but that the trouble we had with it during the recent merges is manily because of the general complexity of the emissions reporting code. I am not in favor of doing such calculations in some repos outside the reporting library as it might always be that others want to use your developments as well. A possible alternative is to do project-specific variables / developments in separate functions like |
For NGFS, ELEVATE and SHAPE, @bs538 and I came to the conclusion that is sufficient to check the variable list in piamInterfaces against the gdx file used for testing convGDX2MIF, so we don't need our own. I implemented that in #534. I also adjusted the code slightly such that the most recent AMT gdx will be tested as well. Overall, we have one less gdx to be converted as of now. Whoever feels responsible for NAVIGATE might go the same way. |
@fbenke-pik: Do you see any way of automatically and regularly uploading the newest AMT gdx file(s) to the rse server, or finding another way people can easily access it? |
Should be possible. But we have limited space on the RSE server. Not sure what you mean by "easily access it" and for what purpose. |
You could overwrite the old one, so limited space shouldn't be a problem. If this works, no need to search for alternatives, I guess. |
I will recap the discussion (as I see it) so far, in order to identify issues
I suggest to separate the issue of gdx tests, which seems to progress on its own On backwards compatibility: Do people prefer a meeting to discuss this, or I certainly see some questions that could use some hard answers:
|
There is no good way around this. Projects should use fixed version of R packages that match the REMIND code they are using. Unless you update REMIND code, do not update the R packages. |
To motivate this issue a bit further, here are the cyclomatic complexity [↑] and code lengths of the worst
|
I briefly discussed with Jess and she is fine that the NAVIGATE-specific test can be removed in the middle of the year once the last paper is submitted. While I would like our code structure and commit discipline as clean as the ideal you describe, I guess that is unreasonable to assume. Therefore, I would strongly opt for keeping and testing backward compatibility at least to a gdx based on the last REMIND release that is still used by any project. If we don't do that, I fear we would need to maintain a new remind2 branch with relevant bug fixes for the release version that is used by many projects. Maybe we can find a nice way of moving backward compatibility code into own subfunctions, such that the code becomes more like
And |
Thanks for adding structure to the discussion Michaja, @0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q , and sorry for being slow to respond (paper submission + project proposal rush...). In an ideal world (clean code-base), Michaja's suggestion of applying only specific cherry-picked fixes to correct reporting problems (and otherwise stick with matching REMIND + R library version) seems like the way to go. In practice, I'm also worried that this would be considerable pain. So from my side, + 1 for the suggestion by @orichters to peg it to REMIND releases. The last major release (v3.2.0 currently) should always be supported in my view, and additionally we can keep track of which project uses which release for the decision when to ditch backwards-compatibility to that version. For SHAPE I used v3.2.0. (I'll be off to parental leave from next week, will re-connect with the discussion in May if it's still open then.) |
With #600, we are now down to 2 gdx files that are tested, covering "regional resolution (H12 and EU21), REMIND version (release and AMT), and climate policy (NPi and PkBudg)." I have the impression that there is broad agreement to support the latest release, but not longer into the past, so I think we could start cleaning up some stuff in the report functions. |
tl;dr
renv
to manage their R packageenvironment
set of module realisations instead
Backwards compatibility was introduced into the
remind2
package (and beforethat in the
remind
package) when we did not have a way to properly manage Rpackage versions on the cluster, and everybody and every project used the common
library of R packages which was (is?) updated whenever a new version of a RSE
package is merged on Github.
But now projects can easily manage their R package environments and keep it
stable with whatever package versions they need and that works for them.
Updates to the
remind2
package are usually tied to updates in the REMIND code.Either projects track the REMIND
develop
branch to benefit from the REMINDupdates — then they will want (need) to get new
remind2
versions, too. Orthey do not track the REMIND developments, in which case there is no point for
them to update the
remind2
package, either.Currently, we are actively tracking compatibility with five projects
all of which closely tracked REMIND development and did not diverge far from it.
So there is no benefit for them from updated
remind2
package versions, either.All the backwards compatibility leads to a Byzantine code structure that nobody
can follow anymore, resulting in increasing complexity and errors, as well as
excessive test times (around 30 minutes currently).
I suggest to ditch the backwards compatibility, and focus on a correctly working
post-processing for current REMIND code instead. Define a set of module
realisations and switches that have to be supported, generate up-to-date gdxes
for them as part of the AMTs, and test for the existence and plausibility of
variables and values in the output.
The text was updated successfully, but these errors were encountered: