From 67b04bc460d0f873aa936625c5a4e430738675f9 Mon Sep 17 00:00:00 2001 From: Laura Wienpahl <57132039+LauWien@users.noreply.github.com> Date: Thu, 5 May 2022 14:39:48 +0200 Subject: [PATCH 1/6] Bump ixmp dependency to 3.5.0 in setup.cfg --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ce8bf08ab..2a0dcc927 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,7 @@ zip_safe = True include_package_data = True install_requires = click - ixmp >= 3.4.0 + ixmp >= 3.5.0 numpy pandas >= 1.2 PyYAML From 3648369c628c91a3612abf20bb69b40575e1b216 Mon Sep 17 00:00:00 2001 From: Laura Wienpahl <57132039+LauWien@users.noreply.github.com> Date: Thu, 5 May 2022 14:43:57 +0200 Subject: [PATCH 2/6] Mark v3.5.0 in release notes --- RELEASE_NOTES.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index f391fa176..b891ec4fc 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -1,5 +1,13 @@ -Next release -============ +.. Next release +.. ============ + +.. All changes +.. ----------- + +.. _v3.5.0: + +v3.5.0 (2022-05-06) +=================== Migration notes --------------- From b164d3de78a3fa7d2a45d493672d4c295d64046f Mon Sep 17 00:00:00 2001 From: Laura Wienpahl <57132039+LauWien@users.noreply.github.com> Date: Thu, 5 May 2022 16:43:17 +0200 Subject: [PATCH 3/6] Move tool config for isort, mypy, pytest to pyproject.toml --- pyproject.toml | 38 +++++++++++++++++++++++++++++++++ setup.cfg | 58 -------------------------------------------------- 2 files changed, 38 insertions(+), 58 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..15bc81c36 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] + +[tool.isort] +profile = "black" + +[[tool.mypy.overrides]] +# Packages/modules for which no type hints are available. +module = [ + "asyncssh", + "matplotlib.*", + "numpy", + "pandas.*", + "pint", + "pyam", + "pytest", + "setuptools", + "xarray", + # Indirectly via ixmp; this should be a subset of the list in ixmp's setup.cfg + "dask", + "jpype", + "nbclient", + "nbformat", + "memory_profiler", + "sparse", +] +ignore_missing_imports = true + +[tool.pytest.ini_options] +# Disable faulthandler plugin on Windows to prevent spurious console noise +addopts = """ + --cov=message_ix --cov-report= + -m "not nightly and not rmessageix" + -p no:faulthandler""" +markers = [ + "nightly: Slow-running nightly tests of particular scenarios.", + "rmessageix: test of the message_ix R interface.", +] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 2a0dcc927..c9e67f176 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,6 @@ classifiers = Topic :: Scientific/Engineering Topic :: Scientific/Engineering :: Information Analysis - [options] packages = message_ix zip_safe = True @@ -65,72 +64,15 @@ tests = pytest-cov requests - [options.entry_points] console_scripts = message-ix = message_ix.cli:main -[tool:pytest] -# Disable faulthandler plugin on Windows to prevent spurious console noise -addopts = --cov=message_ix --cov-report= - -m "not nightly and not rmessageix" - -p no:faulthandler -markers = - nightly: Slow-running nightly tests of particular scenarios. - rmessageix: test of the message_ix R interface. - [codecov.run] omit = message_ix/model/* message_ix/tests/test_nightly.py message_ix/testing/nightly.py -[aliases] -test = pytest - -[isort] -force_grid_wrap = 0 -include_trailing_comma = True -line_length = 88 -multi_line_output = 3 -use_parentheses = True - [flake8] max-line-length = 88 - -[mypy] -# Empty section required as of mypy 0.800; -# see https://github.com/python/mypy/issues/9940 - -[mypy-asyncssh.*] -ignore_missing_imports = True -[mypy-matplotlib.*] -ignore_missing_imports = True -[mypy-numpy.*] -ignore_missing_imports = True -[mypy-pandas.*] -ignore_missing_imports = True -[mypy-pint.*] -ignore_missing_imports = True -[mypy-pyam.*] -ignore_missing_imports = True -[mypy-pytest.*] -ignore_missing_imports = True -[mypy-setuptools.*] -ignore_missing_imports = True -[mypy-xarray.*] -ignore_missing_imports = True - -# Indirectly via ixmp; this should be a subset of the list in ixmp's setup.cfg -[mypy-dask.*] -ignore_missing_imports = True -[mypy-jpype.*] -ignore_missing_imports = True -[mypy-nbclient.*] -ignore_missing_imports = True -[mypy-nbformat.*] -ignore_missing_imports = True -[mypy-memory_profiler.*] -ignore_missing_imports = True -[mypy-sparse.*] -ignore_missing_imports = True From 3ddf927133454fc7945d32484a119403dd98b7ef Mon Sep 17 00:00:00 2001 From: Laura Wienpahl <57132039+LauWien@users.noreply.github.com> Date: Thu, 5 May 2022 16:45:02 +0200 Subject: [PATCH 4/6] Mirror setup.cfg content in pyproject.toml --- pyproject.toml | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 15bc81c36..846f3bba5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,87 @@ [build-system] requires = ["setuptools", "setuptools-scm"] +# Replacement for setup.cfg +# +# Support for this section is experimental in setuptools 61–62.1.0. This should +# not be enabled until that support is stable. +# +# [project] +# name = "message_ix" +# description = "the MESSAGEix integrated assessment model" +# authors = [ +# { email = "message_ix@iiasa.ac.at" }, +# { name = "IIASA Energy, Climate, and Environment (ECE) Program" } +# ] +# license = { text = "Apache" } +# readme = { file = "README.md", content-type = "text/markdown" } +# classifiers = [ +# "Development Status :: 5 - Production/Stable", +# "Intended Audience :: Developers", +# "Intended Audience :: Science/Research", +# "License :: OSI Approved :: Apache Software License", +# "Natural Language :: English", +# "Operating System :: OS Independent", +# "Programming Language :: Python", +# "Programming Language :: Python :: 3", +# "Programming Language :: Python :: 3.7", +# "Programming Language :: Python :: 3.8", +# "Programming Language :: Python :: 3.9", +# "Programming Language :: Python :: 3.10", +# "Programming Language :: R", +# "Topic :: Scientific/Engineering", +# "Topic :: Scientific/Engineering :: Information Analysis" +# ] +# dependencies = [ +# "click", +# "ixmp >= 3.5.0", +# "numpy", +# "pandas >= 1.2", +# "PyYAML", +# ] +# dynamic = ["version"] +# +# [project.urls] +# documentation = "https://docs.messageix.org/" +# repository = "http://github.com/iiasa/message_ix" +# +# [tool.setuptools] +# zip-safe = true +# +# [project.optional-dependencies] +# report = ["ixmp[report]"] +# docs = [ +# # Duplicated from above; see pypa/setuptools#3221 +# "ixmp[report]", +# "numpydoc", +# "sphinx >= 4.0", +# "sphinx_rtd_theme", +# "sphinxcontrib-bibtex", +# ] +# tutorial = [ +# "ixmp[report]", +# "jupyter", +# "matplotlib" +# ] +# test = [ +# "ixmp[report]", +# "numpydoc", +# "sphinx >= 4.0", +# "sphinx_rtd_theme", +# "sphinxcontrib-bibtex", +# "jupyter", +# "matplotlib" +# "asyncssh" +# "pint" +# "pyam-iamc >= 0.6" +# "pytest >= 5" +# "pytest-cov" +# "requests" +# ] +# +# [project.scripts] +# ixmp = "message-ix = message_ix.cli:main" + [tool.isort] profile = "black" From 258523a33fcb668f5121d6cee7e65ca174e324aa Mon Sep 17 00:00:00 2001 From: Laura Wienpahl <57132039+LauWien@users.noreply.github.com> Date: Thu, 5 May 2022 16:46:31 +0200 Subject: [PATCH 5/6] Remove mypy exclusions --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 846f3bba5..fde24a7d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,20 +90,16 @@ profile = "black" module = [ "asyncssh", "matplotlib.*", - "numpy", "pandas.*", - "pint", "pyam", "pytest", "setuptools", - "xarray", # Indirectly via ixmp; this should be a subset of the list in ixmp's setup.cfg "dask", "jpype", "nbclient", "nbformat", "memory_profiler", - "sparse", ] ignore_missing_imports = true From b5a8aa7ad0f46d6fa174836f03feba962ce87627 Mon Sep 17 00:00:00 2001 From: Laura Wienpahl <57132039+LauWien@users.noreply.github.com> Date: Fri, 6 May 2022 10:12:00 +0200 Subject: [PATCH 6/6] Explain #561, #591 in migration notes --- RELEASE_NOTES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index b891ec4fc..7cd1613f8 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -15,6 +15,12 @@ Migration notes The format of input data files for MACRO calibration has been changed in :pull:`327`. Files compatible with v3.4.0 and earlier will not work with this version and should be updated; see details of the current data file format in the :doc:`documentation `. +:pull:`561` corrected the model internal logic for handling zero values in the :ref:`capacity_factor ` parameter. +Before this change, the GAMS code inserted a ``capacity_factor`` value of 1.0 where such zero values appeared; now, zeros are preserved, so the technologies may be created (``CAP``) but none of their capacity will be usable at the +:math:`(n, t, y^V, y, h)` where zero values appear. +This is consistent with the general concept of a “capacity factor”: for instance, a solar photovoltaic technology for electricity generation may have a non-zero *capacity* with a *capacity factor* of 0 at :math:`h=\text{night}`. +This may cause changes in model output for scenarios where such zero values appear; see :issue:`591` for discussion, including methods to check for and adjust/remove such values. + All changes -----------