You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/api/report/index.rst
+63-24Lines changed: 63 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,32 +31,59 @@ Introduction
31
31
See :doc:`the discussion in the MESSAGEix docs <message-ix:reporting>` about the stack.
32
32
In short, for instance:
33
33
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.
37
43
38
44
The basic **design pattern** of :mod:`message_ix_models.report` is:
39
45
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.
and register them with :func:`~report.register` when they are to be used.
43
53
For example:
44
54
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.
55
81
56
82
Features
57
83
========
58
84
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.
60
87
61
88
.. note:: If any of this does not appear to work as advertised, file a bug!
62
89
@@ -65,7 +92,8 @@ Units
65
92
66
93
- Are read automatically for ixmp parameters.
67
94
- 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
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:
137
167
138
168
.. autosummary::
139
169
@@ -255,11 +285,20 @@ Testing
255
285
Continuous reporting
256
286
--------------------
257
287
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>`.
262
299
These workflows:
263
300
264
301
- 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'
0 commit comments