iiasa / message_ix

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

Improve reporting tutorial based on 2019-10-04 feedback #239

Closed khaeru closed 2 years ago

khaeru commented 5 years ago

During the 2–4 October 2019 workshop, we identified some issues with the westeros_reporting.ipynb tutorial:

Please leave a comment with any additional issues.

jkikstra commented 5 years ago

EDIT: this was caused by also having a 0.2.0 version of ixmp installed (which apparently does not have check_keys), which was then being called, rather than the master version. Removing the ixmp package folders and reinstalling by pip install --editable . solves the issue.


After installing ixmp and subsequently _messageix and pyam (see https://github.com/IAMconsortium/pyam/issues/259) from source, I ran into the following issue with westeros_reporting.pynb:


AttributeError                            Traceback (most recent call last)
<ipython-input-12-20b6f6717002> in <module>
      1 # Create a reporter from the existing Scenario
----> 2 rep = Reporter.from_scenario(scen)
      3 
      4 # Reporter uses the Python pint to handle units. '-', used in the Westeros
      5 # tutorial, is not a defined SI unit. We tell the Reporter to replace it with

~\AppData\Local\Continuum\anaconda3\lib\site-packages\message_ix\reporting\__init__.py in from_scenario(cls, scenario, **kwargs)
    144             key += ':pyam'
    145             try:
--> 146                 rep.as_pyam(qty, year_dim, key, collapse=collapse_cb)
    147             except KeyError as e:
    148                 log.info(f'{e.args[0]} not in scenario → not adding {key}')

~\AppData\Local\Continuum\anaconda3\lib\site-packages\message_ix\reporting\__init__.py in as_pyam(self, quantities, year_time_dim, key, drop, collapse)
    195         if isinstance(quantities, (str, Key)):
    196             quantities = [quantities]
--> 197         quantities = self.check_keys(*quantities)
    198 
    199         keys = []

AttributeError: 'Reporter' object has no attribute 'check_keys' ```
jkikstra commented 5 years ago

Near the end of the westeros_reporting.ipynb tutorial, the plotnine package is imported, however this does not automatically get installed with Anaconda, hence the user needs to first install it before being able to run the last plotting part.

So I would suggest to add a line about doing pip install plotnine

khaeru commented 3 years ago

Postponed to v3.3 (or later).

khaeru commented 3 years ago

Postponed 'til after 3.3. Some of the items have already been resolved, as noted in the description above.

khaeru commented 2 years ago

Postponed, as no time to complete this week.