From 3fda0b3837a63b3fabee6a064900010876ac6889 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Thu, 12 Oct 2023 13:07:32 +0200 Subject: [PATCH] =?UTF-8?q?Mark=20add=5Fsimulated=5Fsolution()=20as=20not?= =?UTF-8?q?=20implemented=20for=20message=5Fix=20=E2=89=A4=203.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- message_ix_models/report/sim.py | 8 ++++++++ message_ix_models/tests/test_report.py | 1 + 2 files changed, 9 insertions(+) diff --git a/message_ix_models/report/sim.py b/message_ix_models/report/sim.py index 36a0d4d855..4318410918 100644 --- a/message_ix_models/report/sim.py +++ b/message_ix_models/report/sim.py @@ -262,6 +262,14 @@ def add_simulated_solution( solution data for the MESSAGE variable with the same name. See :func:`data_from_file`. """ + from importlib.metadata import version + + if version("message_ix") < "3.6": + raise NotImplementedError( + "Support for message_ix_models.report.sim.add_simulated_solution() with " + "message_ix <= 3.5.0. Please upgrade to message_ix 3.6 or later." + ) + mark_time() N = len(rep.graph) diff --git a/message_ix_models/tests/test_report.py b/message_ix_models/tests/test_report.py index bfbd022ee2..ea87ea1b8b 100644 --- a/message_ix_models/tests/test_report.py +++ b/message_ix_models/tests/test_report.py @@ -203,6 +203,7 @@ def test_collapse(input, exp): pdt.assert_frame_equal(util.collapse(df_in), df_exp) +@MARK[0] def test_add_simulated_solution(test_context, test_data_path): from message_ix import Reporter