iiasa / iiasa/message_ix

Westeros Baseline Example Reporting Module Error

Open
#787 2 comments 0 reactions 1 assignee Claimed by @glatterf42 View on GitHub
docs
Dominant language
Jupyter Notebook
Stars
150
Forks
178
Avg merge
17h 32m
Merged PRs (30d)
2

Description

**Code sample or context**
When plotting results in westeros_baseline.ipynb there is a typo calling the reporting module. The error can be seen below.

There needs to be a change to the where the module is called so that it calls "from message_ix.reporting import Reporter". This will allow the program to work.

```python
# Create a Reporter object to describe and carry out reporting
# calculations and operations (like plotting) based on `scenario`
from message_ix.report import Reporter

rep = Reporter.from_scenario(scenario)

# "prepare_plots" enables several to describe reporting operations, e.g.
# "plot activity", "plot capacity", or "plot prices"
# See message_ix/util/tutorial.py for more information
from message_ix.util.tutorial import prepare_plots

prepare_plots(rep)
```

#### Expected result
The program should prepare the plots that get called later on.

#### Problem description
Due to the typo, the following error is raised:
```
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
[~\AppData\Local\Temp\ipykernel_24900\3937561850.py](https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/brend/Documents/CIVE%20566/MESSAGE%20Tutorials/iiasa-message_ix-f2bd088/tutorial/westeros/~/AppData/Local/Temp/ipykernel_24900/3937561850.py) in
1 # Create a Reporter object to describe and carry out reporting
2 # calculations and operations (like plotting) based on `scenario`
----> 3 from message_ix.report import Reporter
4
5 rep = Reporter.from_scenario(scenario)

ModuleNotFoundError: No module named 'message_ix.report'
```

#### Versions

Output of message-ix show-versions

```
ixmp: 3.4.0
message_ix: 3.4.0
message_ix_models: None
message_data: None

click: 8.1.7
dask: 2022.02.0
genno: installed
graphviz: None
jpype: 1.4.1
… JVM path: C:\Program Files\Java\jdk-21\bin\server\jvm.dll
openpyxl: 3.0.10
pandas: 1.2.5
pint: 0.17
xarray: 0.20.2
yaml: 6.0

iam_units: installed
jupyter: installed
matplotlib: 3.4.2
plotnine: None
pyam: 1.3.1

GAMS: 38.3.0

python: 3.7.15 (default, Nov 24 2022, 18:44:54) [MSC v.1916 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: (None, None)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.