Closed francescolovat closed 3 years ago
@francescolovat could you please use code permalinks instead of images to refer to existing code? The latter are hard/impossible to read on a mobile browser.
As a general answer, @danielhuppmann @gidden and I previously discussed that the code in /tutorial/utils
should eventually be minimized or removed entirely. Basically, the existence of this code says, "The supposedly-simple tasks in the tutorials actually require many lines of helper code (i.e. the code hidden in plotting.py, etc.)"
The broader goal is that it should truly be simple to do these tasks, using message_ix.reporting
+ pyam
in combination; and the tutorials should show how.
So, to address this specific issue would be fine; but eventually the code should be removed altogether.
In class Plots in
/tutorial/utils/plotting.py
:baseyear
is not used in all the methods (except _plotprices):https://github.com/iiasa/message_ix/blob/357fb37b0f5813f0178e07b11e42b847f9f62e70/tutorial/utils/plotting.py#L31-L46
However, it is still given as an argument in the Jupyter notebooks of the tutorials: i.e.
p.plot_activity(baseyear=True, subset=plants)
This is the only operation applied to the argument in _plotprices: https://github.com/iiasa/message_ix/blob/357fb37b0f5813f0178e07b11e42b847f9f62e70/tutorial/utils/plotting.py#L99-L102
So, I wonder how to deal with it. Should we add the code found in _plotprices to all the methods or should we just remove that argument from all the functions (and also from the code in the tutorial notebooks)?
Please have a look @behnam-zakeri @khaeru