iiasa / message_ix

The integrated assessment and energy systems model MESSAGEix
https://docs.messageix.org
Apache License 2.0
117 stars 152 forks source link

Tutorials: BASEYEAR argument not used in Plots methods #290

Closed francescolovat closed 3 years ago

francescolovat commented 4 years ago

In class Plots in /tutorial/utils/plotting.py:

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

khaeru commented 4 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.

LauWien commented 3 years ago

I think this issue can be closed hence #407 got merged and the folder /tutorial/utils doesn't exist anymore. Please reopen if I'm mistaken :)