From e96819ca3a3acffd96f4d88f8395bdb9e25eb6fc Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Tue, 6 Jul 2021 10:53:39 +0200 Subject: [PATCH 1/5] Adjust test_reporter_from_scenario() for genno 1.5 Use "in rep" not "in rep.graph" for more flexible __contains__. --- message_ix/tests/test_reporting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/message_ix/tests/test_reporting.py b/message_ix/tests/test_reporting.py index 3576021fb..71af20802 100644 --- a/message_ix/tests/test_reporting.py +++ b/message_ix/tests/test_reporting.py @@ -54,10 +54,10 @@ def test_reporter_from_scenario(message_test_mp): assert len(rep.graph["all"]) == 123 # Quantities have short dimension names - assert "demand:n-c-l-y-h" in rep.graph + assert "demand:n-c-l-y-h" in rep # Aggregates are available - assert "demand:n-l-h" in rep.graph + assert "demand:n-l-h" in rep # Quantities contain expected data dims = dict(coords=["chicago new-york topeka".split()], dims=["n"]) From 136add20aa7ea22b7d2e16cb986d5e151f61a780 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Tue, 6 Jul 2021 16:32:01 +0200 Subject: [PATCH 2/5] Correct a format string in .reporting.computations.plot_cumulative() --- message_ix/reporting/computations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix/reporting/computations.py b/message_ix/reporting/computations.py index f373b0836..f6fd6949d 100644 --- a/message_ix/reporting/computations.py +++ b/message_ix/reporting/computations.py @@ -36,7 +36,7 @@ def plot_cumulative(x, y, labels): d0_labels = set(x.coords[d0].values) | set(y.coords[d0].values) assert ( len(d0_labels) == 1 - ), "non-unique values {repr(d0_labels)} for dimension {repr(d0)}" + ), f"non-unique values {repr(d0_labels)} for dimension {repr(d0)}" axes_properties = dict( title=f"{d0_labels.pop()} {labels[0].title()}", From 8d9ac4d272baeba35a61857de976ee944a3be7ed Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Wed, 7 Jul 2021 12:43:33 +0200 Subject: [PATCH 3/5] Git ignore prof/ directory (pytest-profiling) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c4744f616..46a634d1e 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ tests/data/nightly .benchmarks .coverage* .mypy_cache +prof/ .pytest_cache coverage.xml htmlcov From a65f1e358c4987a6e14780d1a3fdacd9401c2dd9 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Wed, 7 Jul 2021 13:03:31 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Adjust=20use=20of=20pyam.IamDataFrame.line?= =?UTF-8?q?=5Fplot()=20=E2=86=92=20plot()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former name was removed in pyam 1.0 --- tutorial/westeros/westeros_report.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial/westeros/westeros_report.ipynb b/tutorial/westeros/westeros_report.ipynb index f077538d3..27224dfd2 100644 --- a/tutorial/westeros/westeros_report.ipynb +++ b/tutorial/westeros/westeros_report.ipynb @@ -760,7 +760,7 @@ " scenario='baseline',\n", " region='Westeros'\n", " )\n", - " .line_plot()\n", + " .plot()\n", ")" ] }, From 2df44f8849a5f0c57b2ae7e47631ad38109ea64b Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Wed, 7 Jul 2021 14:08:11 +0200 Subject: [PATCH 5/5] Add #492 to release notes --- RELEASE_NOTES.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index a2d680bf0..e10871ecb 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -1,8 +1,11 @@ -.. Next release -.. ============ +Next release +============ + +All changes +----------- + +- Adjust the Westeros reporting tutorial to pyam 1.0 deprecations (:pull:`492`). -.. All changes -.. ----------- .. _v3.3.0: