Skip to content

Commit 5ec3701

Browse files
committed
Use semantic line breaks in doc/api/report/index
1 parent 47e0fc5 commit 5ec3701

File tree

1 file changed

+63
-24
lines changed

1 file changed

+63
-24
lines changed

doc/api/report/index.rst

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,59 @@ Introduction
3131
See :doc:`the discussion in the MESSAGEix docs <message-ix:reporting>` about the stack.
3232
In short, for instance:
3333

34-
- :mod:`message_ix` **must not** contain reporting code that references :py:`technology="coal_ppl"`, because not every model built on the MESSAGE framework will have a technology with this name.
35-
- Any model in the MESSAGEix-GLOBIOM family—built with :mod:`message_ix_models` and/or :mod:`message_data`—**should**, with few exceptions, have a :py:`technology="coal_ppl"`, since this appears in the common list of :ref:`technology-yaml`.
36-
Reporting specific to this technology ID, *as it is represented* in this model family, should be in :mod:`message_ix_models` or user code.
34+
- :mod:`message_ix` **must not** contain reporting code that references :py:`technology="coal_ppl"`,
35+
because not every model built on the MESSAGE framework will have a technology with this name.
36+
- Any model in the MESSAGEix-GLOBIOM family
37+
—built with :mod:`message_ix_models` and/or :mod:`message_data`—
38+
**should**, with few exceptions, have a :py:`technology="coal_ppl"`,
39+
since this appears in the common list of :ref:`technology-yaml`.
40+
Reporting specific to this technology ID,
41+
*as it is represented* in this model family,
42+
should be in :mod:`message_ix_models` or user code.
3743

3844
The basic **design pattern** of :mod:`message_ix_models.report` is:
3945

40-
- :func:`~.report.prepare_reporter` populates a new :class:`~.message_ix.Reporter` for a given :class:`.Scenario` with many keys to report all quantities of interest in a MESSAGEix-GLOBIOM–family model.
41-
- This function relies on *callbacks* defined in multiple submodules to add keys and tasks for general or tailored reporting calculations and actions.
42-
Additional modules **should** define callback functions and register them with :func:`~report.register` when they are to be used.
46+
- :func:`~.report.prepare_reporter` populates a new :class:`~.message_ix.Reporter`
47+
for a given :class:`.Scenario` with many tasks
48+
to report all quantities of interest in a MESSAGEix-GLOBIOM–family model.
49+
- This function relies on *callbacks* defined in multiple submodules
50+
to add keys and tasks for general or tailored reporting calculations and actions.
51+
Additional modules **should** define callback functions
52+
and register them with :func:`~report.register` when they are to be used.
4353
For example:
4454

45-
1. The module :mod:`message_ix_models.report.plot` defines :func:`.plot.callback` that adds standard plots to the Reporter.
46-
2. The module :mod:`message_data.model.transport.report` defines :func:`~.message_data.model.transport.report.callback` that adds tasks specific to MESSAGEix-Transport.
47-
3. The module :mod:`message_data.projects.navigate.report` defines :func:`~.message_data.projects.navigate.report.callback` that add tasks specific to the ‘NAVIGATE’ research project.
48-
49-
The callback (1) is always registered, because these plots are always applicable and can be expected to function correctly for all models in the family. In contrast, (2) and (3) **should** only be registered and run for the specific model variants for which they are developed/intended.
50-
51-
Modules with tailored reporting configuration **may** also be indicated on the :ref:`command line <report-cli>` by using the :program:`-m/--modules` option: :program:`mix-models report -m model.transport`.
52-
53-
- A file :file:`global.yaml` file (in `YAML <https://en.wikipedia.org/wiki/YAML#Example>`_ format) contains a description of some of the reporting computations needed for a MESSAGE-GLOBIOM model.
54-
:func:`~.report.prepare_reporter` uses the :doc:`configuration handlers <genno:config>` built into :mod:`genno` (and some extensions specific to :mod:`message_ix_models`) to handle the different sections of the file.
55+
1. The module :mod:`message_ix_models.report.plot` defines :func:`.plot.callback`
56+
that adds standard plots to the Reporter.
57+
2. The module :mod:`message_ix_models.model.transport.report` defines :func:`~.transport.report.callback`
58+
that adds tasks specific to the MESSAGEix-Transport model variant.
59+
3. The module :mod:`message_ix_models.project.navigate.report` defines :func:`~.navigate.report.callback`
60+
that add tasks specific to the ‘NAVIGATE’ research project.
61+
62+
The callback (1) is always registered,
63+
because these plots are always applicable and can be expected to function correctly
64+
for all models in the family.
65+
In contrast, (2) and (3) **should** only be registered and run
66+
for the specific model variants for which they are developed/intended.
67+
68+
Modules with tailored reporting configuration **may** also be indicated
69+
on the :ref:`command line <report-cli>`
70+
by using the :program:`-m/--modules` option:
71+
:program:`mix-models report -m model.transport`.
72+
73+
- A file :file:`global.yaml`
74+
(in `YAML <https://en.wikipedia.org/wiki/YAML#Example>`_ format)
75+
contains a description of some of the reporting computations
76+
needed for a MESSAGE-GLOBIOM model.
77+
:func:`~.report.prepare_reporter` uses the :doc:`configuration handlers <genno:config>`
78+
built into :mod:`genno`
79+
(and some extensions specific to :mod:`message_ix_models`)
80+
to handle the different sections of the file.
5581

5682
Features
5783
========
5884

59-
By combining these genno, ixmp, message_ix, and message_ix_models features, the following functionality is provided.
85+
By combining these genno, ixmp, message_ix, and message_ix_models features,
86+
the following functionality is provided.
6087

6188
.. note:: If any of this does not appear to work as advertised, file a bug!
6289

@@ -65,7 +92,8 @@ Units
6592

6693
- Are read automatically for ixmp parameters.
6794
- Pass through calculations/are derived automatically.
68-
- Are recognized based on the definitions of non-SI units from `IAMconsortium/units <https://github.com/IAMconsortium/units/>`_.
95+
- Are recognized based on the definitions of non-SI units from
96+
`IAMconsortium/units <https://github.com/IAMconsortium/units/>`_.
6997
- Are discarded when inconsistent.
7098
- Can be overridden for entire parameters:
7199

@@ -133,7 +161,9 @@ Operators
133161
remove_ts
134162
share_curtailment
135163

136-
The following functions, defined elsewhere, are exposed through :mod:`.operator` and so can also be referenced by name:
164+
The following functions, defined elsewhere,
165+
are exposed through :mod:`.operator`
166+
and so can also be referenced by name:
137167

138168
.. autosummary::
139169

@@ -255,11 +285,20 @@ Testing
255285
Continuous reporting
256286
--------------------
257287

258-
As part of the :ref:`test-suite`, reporting is run on the same events (pushes and daily schedule) on publicly-available :doc:`model snapshots </api/model-snapshot>`.
259-
One goal of these tests *inter alia* is to ensure that adjustments and improvements to the reporting code do not disturb manually-verified model outputs.
260-
261-
As part of the (private) :mod:`message_data` test suite, multiple workflows run on regular schedules; some of these include a combination of :mod:`message_ix_models`-based and :ref:`‘legacy’ reporting <report-legacy>`.
288+
As part of the :ref:`test-suite`, reporting is run on the same events
289+
(pushes and daily schedule)
290+
on publicly-available :doc:`model snapshots </api/model-snapshot>`.
291+
One goal of these tests *inter alia* is to ensure that adjustments
292+
and improvements to the reporting code
293+
do not disturb manually-verified model outputs.
294+
295+
As part of the (private) :mod:`message_data` test suite,
296+
multiple workflows run on regular schedules;
297+
some of these include a combination of :mod:`message_ix_models`-based
298+
and :ref:`‘legacy’ reporting <report-legacy>`.
262299
These workflows:
263300

264301
- Operate on specific scenarios within IIASA databases.
265-
- Create files in CSV, Excel, and/or PDF formats that are that are preserved and made available as 'build artifacts' via the GitHub Actions web interface and API.
302+
- Create files in CSV, Excel, and/or PDF formats
303+
that are that are preserved and made available as 'build artifacts'
304+
via the GitHub Actions web interface and API.

0 commit comments

Comments
 (0)