Skip to content

Commit 0d563fc

Browse files
committed
Add #325 to doc/whatsnew
1 parent 8ca4f1a commit 0d563fc

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

doc/project/ssp.rst

+11-10
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,21 @@ Transport
7272
1. To process data from file, use :program:`mix-models ssp transport --help in.xlsx out.xlsx` to invoke :func:`.process_file`.
7373
Data are read from PATH_IN, in :file:`.xlsx` or :file:`.csv` format.
7474
If :file:`.xlsx`, the data are first temporarily converted to :file:`.csv`.
75-
Data are written to PATH_OUT; if not given, this defaults to the same path and suffix as PATH_IN, with "_out" added to the stem.
75+
Data are written to PATH_OUT;
76+
if not given, this defaults to the same path and suffix as PATH_IN with "_out" added to the stem.
7677

7778
For example:
7879

7980
.. code-block:: shell
8081
81-
mix-models ssp transport --method=B \
82+
mix-models --platform=ixmp-dev \
83+
ssp transport --method=C \
8284
SSP_SSP2_v2.1_baseline.xlsx
8385
8486
…produces a file :file:`SSP_SSP2_v2.1_baseline_out.xlsx` in the same directory.
8587

86-
2. To process an existing :class:`pandas.DataFrame` from other code, call :func:`.process_df`, passing the input dataframe and the `method` parameter.
88+
2. To process an existing :class:`pandas.DataFrame` from other code, call :func:`.process_df`,
89+
passing the input dataframe and the `method` parameter.
8790

8891
As of 2025-03-07 / :pull:`309`, the set of required "variable" codes handled includes::
8992

@@ -92,15 +95,13 @@ Transport
9295
Emissions|.*|Energy|Demand|Transportation
9396
Emissions|.*|Energy|Demand|Transportation|Road Rail and Domestic Shipping
9497

95-
The previous set is no longer supported.
96-
97-
As of 2025-01-25:
98-
99-
- The set of "variable" codes modified includes::
98+
The previous set, supported as of 2025-01-25 but no longer supported, included::
10099

101100
Emissions|.*|Energy|Demand|Transportation|Aviation
102101
Emissions|.*|Energy|Demand|Transportation|Aviation|International
103102
Emissions|.*|Energy|Demand|Transportation|Road Rail and Domestic Shipping
104103

105-
- Method 'B' (that is, :func:`.prepare_method_B`; see its documentation) is the preferred method.
106-
- The code is tested on :file:`.xlsx` files in the (internal) directories under `SharePoint > ECE > Documents > SharedSocioeconomicPathways2023 > Scenario_Vetting <https://iiasahub.sharepoint.com/sites/eceprog/Shared%20Documents/Forms/AllItems.aspx?csf=1&web=1&e=APKv0Z&CID=23fa0a51%2Dc303%2D4381%2D8c6d%2D143305cbc5a1&FolderCTID=0x012000AA9481BF7BE9264E85B14105F7F082FF&id=%2Fsites%2Feceprog%2FShared%20Documents%2FSharedSocioEconomicPathways2023%2FScenario%5FVetting&viewid=956acd8a%2De1e7%2D4ae9%2Dab1b%2D0506911bae11>`_, for example :file:`v2.1_Internal_version_Dec13_2024/Reporting_output/SSP_SSP2_v2.1_baseline.xlsx`.
104+
- Method 'C' (that is, :func:`.method_C`; see its documentation) is the preferred method.
105+
- The code is tested on :file:`.xlsx` files in the (internal) directories under `SharePoint > ECE > Documents > SharedSocioeconomicPathways2023 > Scenario_Vetting <https://iiasahub.sharepoint.com/sites/eceprog/Shared%20Documents/Forms/AllItems.aspx?csf=1&web=1&e=APKv0Z&CID=23fa0a51%2Dc303%2D4381%2D8c6d%2D143305cbc5a1&FolderCTID=0x012000AA9481BF7BE9264E85B14105F7F082FF&id=%2Fsites%2Feceprog%2FShared%20Documents%2FSharedSocioEconomicPathways2023%2FScenario%5FVetting&viewid=956acd8a%2De1e7%2D4ae9%2Dab1b%2D0506911bae11>`_,
106+
for example :file:`v2.1_Internal_version_Dec13_2024/Reporting_output/SSP_SSP2_v2.1_baseline.xlsx`
107+
or :file:`v2.3_v2.4_Submission_Mar01_2025/Scenario_Reporting_Files/SSP_LED_v2.3.1_baseline.xlsx`

doc/whatsnew.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ SSP :ref:`ssp-2024`/ScenarioMIP
4444

4545
Improve :mod:`.ssp.transport`:
4646

47-
- Add :func:`.prepare_method_B` and make this the default (:pull:`259`).
47+
- Add :func:`~.ssp.transport.method_B` and make this the default (:pull:`259`).
48+
- Add :func:`~.ssp.transport.method_C` (:issue:`305`, :pull:`325`).
4849
- Add :func:`~.ssp.transport.process_df` (:pull:`303`).
4950
- Adapt to revised ‘variable’ codes (:pull:`309`, :issue:`304`).
5051

message_ix_models/project/ssp/transport.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
#: Dimensions of several quantities.
2929
DIMS = "e n t y UNIT".split()
3030

31-
#: Expression used to extract :math:`(e, t)` dimension coordinates from variable codes
32-
#: in :func:`v_to_emi_coords`.
31+
#: Expression used to select and extract :math:`(e, t)` dimension coordinates from
32+
#: variable codes in :func:`v_to_emi_coords`.
3333
EXPR_EMI = re.compile(
3434
r"^Emissions\|(?P<e>[^\|]+)\|Energy\|Demand\|(?P<t>(Bunkers|Transportation).*)$"
3535
)
36-
#: Expression used to extract :math:`(c)` dimension coordinates from variable codes in
37-
#: :func:`v_to_fe_coords`.
36+
#: Expression used to select and extract :math:`(c)` dimension coordinates from variable
37+
#: codes in :func:`v_to_fe_coords`.
3838
EXPR_FE = re.compile(r"^Final Energy\|Transportation\|(?P<c>Liquids\|Oil)$")
3939

4040
#: Keywords for :func:`.iamc_like_data_for_query` / :func:`.to_quantity`.
@@ -321,8 +321,8 @@ def get_computer(
321321
def get_scenario_code(model_name: str, scenario_name: str) -> "sdmx.model.common.Code":
322322
"""Return a specific code from ``CL_TRANSPORT_SCENARIO``.
323323
324-
This function handles (`model_name`, `scenario_name`) combinations seen in base
325-
model outputs as of 2025-04-02.
324+
See :func:`.get_cl_scenario`. This function handles (`model_name`, `scenario_name`)
325+
combinations seen in base model outputs as of 2025-04-02.
326326
"""
327327
from message_ix_models.model.transport.config import get_cl_scenario
328328

@@ -371,9 +371,9 @@ def method_B(c: "Computer") -> None:
371371
"""Prepare calculations up to :data:`K.emi` using :data:`METHOD.B`.
372372
373373
This method uses the |y0| share of aviation in total transport final energy as
374-
indicated by :class:`.IEA_EWEB` (with dimensions :math:`(c, n)`) to disaggregate
375-
total final energy from the input data, then applies emission factors to compute
376-
aviation emissions.
374+
indicated by :class:`.IEA_EWEB`, with dimensions :math:`(c, n)`, to disaggregate
375+
total final energy from the input data, then applies emission intensity data to
376+
compute aviation emissions.
377377
378378
Excluding data transformations, units, and other manipulations for alignment:
379379
@@ -505,7 +505,7 @@ def method_C(c: "Computer") -> None:
505505
"""Prepare calculations up to :data:`K.emi` using :data:`METHOD.C`.
506506
507507
This method uses a solved MESSAGEix-Transport scenario to compute the share of
508-
aviation in total transport final energy (with dimensions :math:`(c, n, y)`), and
508+
aviation in total transport final energy, with dimensions :math:`(c, n, y)`, and
509509
the proceeds similarly to :func:`method_B`.
510510
511511
Excluding data transformations, units, and other manipulations for alignment:

0 commit comments

Comments
 (0)