diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 9668e8c6c..023a77cd6 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -4,6 +4,8 @@ Next release All changes ----------- +- `#307 `_: adjust to deprecations in ixmp 2.0. + v2.0.0 (2020-01-14) =================== diff --git a/ci/pip-requirements.txt b/ci/pip-requirements.txt index 9846cbbfe..6855113cd 100644 --- a/ci/pip-requirements.txt +++ b/ci/pip-requirements.txt @@ -1,5 +1,5 @@ # Always track ixmp master -git+git://github.com/iiasa/ixmp.git#egg=ixmp +git+git://github.com/iiasa/ixmp.git@master#egg=ixmp # pyam-iamc # Temporary: see https://github.com/IAMconsortium/pyam/issues/259 diff --git a/message_ix/cli.py b/message_ix/cli.py index c79a801bd..bc431e55b 100644 --- a/message_ix/cli.py +++ b/message_ix/cli.py @@ -5,7 +5,7 @@ import zipfile import click -from ixmp import config +import ixmp from ixmp.cli import main import message_ix import message_ix.tools.add_year.cli @@ -20,6 +20,9 @@ Run `pip install [--editable] .[tests]`. """ +# Override the class used by the ixmp CLI to load Scenario objects +ixmp.cli.ScenarioClass = message_ix.Scenario + @main.command('copy-model') @click.option('--set-default', is_flag=True, @@ -67,8 +70,8 @@ def copy_model(path, overwrite, set_default): copyfile(src, dst) if set_default: - config.set('message model dir', path) - config.save() + ixmp.config.set('message model dir', path) + ixmp.config.save() @main.command() diff --git a/tests/test_cli.py b/tests/test_cli.py index 9bad4df47..28c0baa87 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -31,9 +31,9 @@ def test_copy_model(message_ix_cli, tmp_path, tmp_env): @pytest.mark.parametrize('opts', [ # During release prep, 'dl' will try to download e.g. v2.0.0, which does # not yet exist; so the test fails. Use this line: - pytest.param('', marks=pytest.mark.xfail), + # pytest.param('', marks=pytest.mark.xfail), # Otherwise (normal state on master), use this line: - # '', + '', '--branch=master', '--tag=1.2.0', ]) diff --git a/tests/test_core.py b/tests/test_core.py index 081083a97..4749e48f6 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -2,9 +2,9 @@ import ixmp import numpy as np -from numpy import testing as npt +import numpy.testing as npt import pandas as pd -import pandas.util.testing as pdt +import pandas.testing as pdt import pytest from message_ix import Scenario diff --git a/tutorial/utils/run_scenarios.py b/tutorial/utils/run_scenarios.py index 0a992554d..ea60c4b21 100644 --- a/tutorial/utils/run_scenarios.py +++ b/tutorial/utils/run_scenarios.py @@ -8,7 +8,7 @@ def check_local_model(model, notebook, shell=False): - mp = ixmp.Platform(dbtype='HSQLDB') + mp = ixmp.Platform() if model in mp.scenario_list().model.unique(): mp.close_db() return @@ -41,7 +41,7 @@ def make_scenario(platform, country, name, base_scen, scen): by = "by 'tutorial/utils/run_scenarios.py:make_scenario()'" ds = base_ds.clone( name, scen, "scenario generated {}, {} - {}".format(by, name, scen), - keep_sol=False) + keep_solution=False) ds.check_out() yield ds