Skip to content

Commit a03767f

Browse files
committed
Add #225 to doc/whatsnew
1 parent 736c0f4 commit a03767f

File tree

7 files changed

+73
-6
lines changed

7 files changed

+73
-6
lines changed

doc/api/util.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ Commonly used:
101101

102102
A Context instance always has the following members:
103103

104-
1. :attr:`core``: an instance of :class:`message_ix_models.Config`.
105-
2. :attr:`model``: an instance of :class:`message_ix_models.model.Config`.
106-
3. :attr:`report``: an instance of :class:`message_ix_models.report.Config`.
104+
1. :attr:`core`: an instance of :class:`message_ix_models.Config`.
105+
2. :attr:`model`: an instance of :class:`message_ix_models.model.Config`.
106+
3. :attr:`report`: an instance of :class:`message_ix_models.report.Config`.
107107

108108
Attributes of (1) and (2) **may** be accessed by shorthand/aliases.
109109
For instance, :py:`context.regions` is an alias for :py:`context.model.regions`.
@@ -215,3 +215,11 @@ Commonly used:
215215

216216
.. automodule:: message_ix_models.util.sdmx
217217
:members:
218+
219+
:mod:`.types`
220+
=============
221+
222+
.. currentmodule:: message_ix_models.types
223+
224+
.. automodule:: message_ix_models.types
225+
:members:

doc/pkg-data/codelists.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ These codes have the following annotations:
2525
.. literalinclude:: ../../message_ix_models/data/commodity.yaml
2626
:language: yaml
2727

28+
.. _emission-yaml:
29+
2830
Emission species (:file:`emission.yaml`)
2931
========================================
3032

doc/whatsnew.rst

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Next release
77
- :mod:`message_ix_models` is tested and compatible with `Python 3.13 <https://www.python.org/downloads/release/python-3130/>`__ (:pull:`250`).
88
- Support for Python 3.8 is dropped (:pull:`250`), as it has reached end-of-life.
99
- Expand :doc:`repro` with sections on :ref:`repro-doc` and :ref:`versioning`, including :ref:`a list of external model names and ‘versions’ <model-names>` like “MESSAGEix-GLOBIOM 2.0” (:issue:`224`, :pull:`226`).
10+
- New code list :ref:`emission-yaml` (:pull:`225`).
1011

1112
By topic:
1213

@@ -23,7 +24,23 @@ Materials
2324
Transport
2425
---------
2526

26-
- Update :doc:`/transport/index` (:pull:`213`).
27+
- Update :doc:`/transport/index` (:pull:`213`, :pull:`225`).
28+
- Rework :mod:`~.transport.freight`, :mod:`~.transport.ldv`, and :mod:`~.transport.non_ldv` to use :mod:`genno` consistently.
29+
- Adopt consistent terms "F RAIL" and "F ROAD" for freight service/modes.
30+
- New technologies: "f rail {electr,lightoil}", "f road electr".
31+
- Extend unit annotations to all transport commodities.
32+
- New input :doc:`files </transport/input>` :file:`pdt-cap.csv` and :file:`load-factor-ldv.csv`.
33+
- Add :program:`mix-models ssp transport` CLI command to postprocess aviation emissions data.
34+
- New SDMX Codelist ``IIASA:CL_TRANSPORT_SCENARIO`` to distinguish “Low energy demand (LED)” and :doc:`/project/edits` scenarios from :doc:`/project/ssp` baseline scenarios.
35+
- Adjust R12 baseline settings:
36+
37+
- :file:`mode-share/default.csv`: adjust ``R12_NAM`` values for AIR and LDV.
38+
- :file:`pdt-cap-ref.csv`: adjust ``R12_NAM`` value.
39+
- Implement LED scenarios via :file:`load-factor-ldv.csv` and :file:`pdt-cap.csv`.
40+
- Use y=2019 data from IEA EWEB 2024 edition to align MESSAGEix-Transport with base model calibration.
41+
- New :mod:`genno` operators: :func:`~.transport.operator.broadcast`, :func:`~.transport.operator.broadcast_wildcard`, :func:`~.transport.operator.broadcast_t_c_l`, :func:`~.transport.operator.freight_usage_output`.
42+
- New utility methods :func:`~.transport.config.get_cl_scenario`, :func:`~.transport.util.wildcard`.
43+
- Replace :class:`DataSourceConfig.LDV <.transport.config.DataSourceConfig>` setting with :attr:`Config.dummy_LDV <.transport.config.Config.dummy_LDV>`.
2744

2845
Water/Nexus
2946
-----------
@@ -51,6 +68,39 @@ Others
5168

5269
- Add "LED", "SSP4", and "SSP5" as values for the :program:`--ssp=…` option in :func:`.common_params` (:pull:`233`).
5370
- Add :doc:`/project/circeular` project code and documentation (:pull:`232`).
71+
- :mod:`.iea.web` handles the 2024 edition and fixed-width file format published by the IEA directly (:pull:`225`).
72+
73+
- Code lists for the ``COUNTRY``, ``FLOW``, and ``PRODUCT`` concepts are included with :mod:`message_ix_models`.
74+
- Add :data:`~.iea.web.COUNTRY_NAME` to map particular labels appearing in these data.
75+
- Fuzzed data and tests for this functionality.
76+
77+
- Add :any:`.types.ParameterData` and :any:`.types.MutableParameterData` to type the common internal data structure in which a :class:`dict` maps from MESSAGE parameter names to :mod:`message_ix`-structured :class:`pandas.DataFrame` (:pull:`225`).
78+
- :class:`message_ix_models.Config`—the “core” configuration class—gains methods specific to its settings (:pull:`225`).
79+
These were formerly on :class:`.Context`.
80+
- :class:`.Context` is no longer a subclass of :class:`dict` (:pull:`225`).
81+
This avoids its mishandling by :mod:`dask` version 2024.11.0 or later when Context is used with :class:`ixmp.Reporter`.
82+
83+
- Add :data:`.MODULE_WITH_CONFIG_DATACLASS`;
84+
add attributes such as :attr:`.Context.model` that are typed to the respective class such as :class:`.model.Config`.
85+
- Add :meth:`.Context.asdict` for serialization.
86+
- Former methods such as :meth:`.Context.get_scenario` are aliased to their new locations, e.g. :meth:`.Config.get_scenario`.
87+
88+
- Improve :class:`.ScenarioInfo` (:pull:`225`):
89+
90+
- Implement the :py:`|` (logical OR/union) operator: `si_a | si_b` is a new ScenarioInfo instance with the union of the contents of the operands.
91+
- New method :meth:`.substitute_codes` to replace string codes (for instance, determined from a Scenario object) with Codes from the corresponding code list, including all annotations.
92+
93+
- :class:`.MappingAdapter` skips missing labels in the input data without raising an exception (:pull:`225`).
94+
- :meth:`.Workflow.visualize` displays in left-to-right rank direction by default (:pull:`225`).
95+
- :func:`.convert_units` can handle MESSAGE-scheme :class:`pandas.DataFrame` (:pull:`225`).
96+
- :func:`.util.sdmx.make_enum` uses :class:`.URNLookupEnum` by default (:pull:`225`).
97+
This allows to call, for instance, :py:`SSP_2024.by_urn("…Code=ICONICS:SSP(2024).2")` to retrieve an enumeration number.
98+
- :func:`.make_matched_dfs` accepts :class:`dict` for its :py:`par_value` arg, allowing replacement of values for particular dimensions of output data frames (:pull:`225`).
99+
- New reporting operator :func:`.quantity_from_iamc` (:pull:`225`).
100+
- :func:`.same_node` and :func:`.same_time` can handle :any:`.ParameterData` (:pull:`225`).
101+
- :func:`.report.register` becomes :meth:`.report.Config.register` which populates :attr:`.report.Config.callback` (:pull:`225`).
102+
The set of callback functions used to configure a class:`.Reporter` instance is thus now particular to a :class:`.report.Config` instance attached to a :class:`.Context` instance.
103+
This allows better isolation of code/tests that use different sets of callbacks.
54104

55105
v2024.8.6
56106
=========

message_ix_models/project/ssp/structure.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,8 @@ def generate(context: "Context", base_dir: Optional["PathLike"] = None):
183183
write(cl, base_dir)
184184

185185

186+
#: Enumeration of codes for SSP 2017 edition.
186187
SSP = SSP_2017 = make_enum("ICONICS:SSP(2017)")
188+
189+
#: Enumeration of codes for SSP 2024 edition.
187190
SSP_2024 = make_enum("ICONICS:SSP(2024)")

message_ix_models/report/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ class Config(ConfigHelper):
5959
#:
6060
#: from message_ix.report import Reporter
6161
#: from message_ix_models import Context
62-
#: from message_ix_models.report import register
6362
#:
6463
#: def cb(rep: Reporter, ctx: Context) -> None:
6564
#: # Modify `rep` by calling its methods ...
6665
#: pass
6766
#:
68-
#: context.report.register(cb)
67+
#: # Register this callback on an existing Context instance
68+
#: context.report.register(cb)
6969
callback: list[Callback] = field(default_factory=_default_callbacks)
7070

7171
#: Path to write reporting outputs when invoked from the command line.

message_ix_models/report/operator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"make_output_path",
3939
"model_periods",
4040
"nodes_ex_world",
41+
"quantity_from_iamc",
4142
"remove_ts",
4243
"share_curtailment",
4344
]

message_ix_models/util/context.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,17 @@ def set(self, key: str, value: Any) -> None:
180180
# These SHOULD include all the keys from MODULE_WITH_CONFIG_DATACLASS
181181
@property
182182
def core(self) -> "message_ix_models.util.config.Config":
183+
"""An instance of :class:`.util.config.Config`."""
183184
return self._values["core"]
184185

185186
@property
186187
def model(self) -> "message_ix_models.model.config.Config":
188+
"""An instance of :class:`.model.config.Config`."""
187189
return self._values["model"]
188190

189191
@property
190192
def report(self) -> "message_ix_models.report.config.Config":
193+
"""An instance of :class:`.report.config.Config`."""
191194
return self._values["report"]
192195

193196
# Dict-like behaviour

0 commit comments

Comments
 (0)