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/develop.rst
+199-2Lines changed: 199 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,11 @@ In the following, the bold-face words **required**, **optional**, etc. have spec
8
8
On other pages:
9
9
10
10
- :doc:`message-ix:contributing` in the MESSAGEix docs.
11
-
*All* of these apply to contributions to :mod:`message_ix_models` and :mod:`message_data`, including the :ref:`message-ix:code-style`.
12
-
- :doc:`data`, for how to add and handle these.
11
+
*All* of these apply to contributions to :mod:`message_ix_models`
12
+
and :mod:`message_data`,
13
+
in particular the :ref:`message-ix:code-style`.
14
+
- :doc:`howto/index` including detailed guides for some development tasks.
15
+
- :doc:`data` that explains types of data and how they are handled.
13
16
14
17
On this page:
15
18
@@ -83,6 +86,171 @@ For :mod:`message_ix_models`, we use this to designate people who are capable an
83
86
84
87
- If code owners depart IIASA or are reassigned to other work, they or the :mod:`message_ix_models` maintainers **must** initiate a discussion to identify a new set of owners for their files.
85
88
89
+
Organization
90
+
============
91
+
92
+
This section describes the organization or layout
93
+
of the :mod:`message_ix_models` repository and Python package.
94
+
The organization of :mod:`message_data` is roughly similar,
95
+
with some differences as noted below.
96
+
(See also :doc:`howto/migrate`
97
+
for the relationship between this repo and :mod:`message_data`.)
98
+
99
+
.. _repo-org:
100
+
101
+
Repository
102
+
----------
103
+
104
+
:file:`message_ix_models/`
105
+
(or :file:`message_data/`)
106
+
107
+
This directory contains a Python package,
108
+
thus *code* that creates or manipulates MESSAGE Scenarios,
109
+
or handles data for these tasks.
110
+
See :ref:`code-org` below.
111
+
112
+
:file:`message_ix_models/data/`
113
+
This directory contains :doc:`data`,
114
+
in particular metadata and input data used by code.
115
+
No code is kept in this directory;
116
+
code **must not** be added.
117
+
Code **should not** write output data (for example, reporting output)
118
+
to this directory.
119
+
120
+
Some of these files are packaged with the :mod:`message_ix_models` package
121
+
that is published on PyPI,
122
+
thus are available to any user who installs the package from this source.
123
+
124
+
In :mod:`message_data`,
125
+
a directory :file:`data/` at the *top level* is used instead.
126
+
Similarly, code cannot be kept in this directory;
127
+
only code under :file:`message_data/` can be imported
128
+
using :py:`from message_data.submodule.name import x, y, z`.
129
+
130
+
:file:`doc/`
131
+
The source reStructuredText files for this **documentation**,
132
+
and Sphinx configuration (:file:`doc/conf.py`) to build it.
133
+
134
+
:file:`reference/`
135
+
(:mod:`message_data` only)
136
+
137
+
Static files not used *or* produced by the code,
138
+
but provided for reference as a supplement to the documentation.
139
+
140
+
.. _code-org:
141
+
142
+
Code
143
+
----
144
+
145
+
The code is organized into submodules.
146
+
The following high-level overview
147
+
explains how the organization relates to MESSAGEix-GLOBIOM modeling workflows.
148
+
Some general-purpose modules, classes, and functions are not mentioned;
149
+
for these, see the table of contents.
150
+
See also :ref:`modindex` for an auto-generated list of all modules.
151
+
152
+
Models (:mod:`message_ix_model.model`)
153
+
**Code that creates models or model variants.**
154
+
MESSAGEix-GLOBIOM is a *family* of models
155
+
in which the “reference energy system”
156
+
(RES; with specific sets and populated parameter values)
157
+
is similar, yet not identical.
158
+
Many models in the family are defined as *derivatives* of other models.
159
+
160
+
For example: :mod:`message_ix_models.model.transport` does not create an RES
161
+
in an empty :class:`.Scenario`, from scratch.
162
+
Instead, it operates on a ‘base’ model
163
+
and produces a new model
164
+
—in this case, with additional transport sector technologies.
165
+
166
+
In the long run (see :ref:`Roadmap`),
167
+
:mod:`message_ix_models.model` will contain a script
168
+
that recreates a **‘main’** (single, authoritative) MESSAGEix-GLOBIOM RES,
169
+
from scratch.
170
+
Currently, this script does not exist,
171
+
and this ‘main’ RES is itself derived from particular models and scenarios
172
+
stored in the shared IIASA ECE database.
173
+
These were previously from the CD-LINKS project,
174
+
and more recently from the ENGAGE project.
175
+
See :doc:`m-data:reference/model`.
176
+
177
+
In the private package, :mod:`message_data.model` also contains:
178
+
179
+
- A *general-purpose* :class:`~.model.scenario_runner.ScenarioRunner`
180
+
*class* to manage and run interdependent sets of Scenarios.
181
+
- A runscript for a *standard scenario set*,
182
+
based on the scenario protocol of the :doc:`CD-LINKS <m-data:reference/projects/cd_links>` project;
The test suite is arranged in modules and submodules
241
+
that correspond to the code layout.
242
+
For example:
243
+
a function named :py:`do_thing()` in a module :py:`message_ix_models.project.foo.report.extra`
244
+
will be tested in a module :py:`message_ix_models.tests.project.foo.report.test_extra`,
245
+
and a function named :py:`test_do_thing()`.
246
+
This arrangement makes it easy to locate the tests for any code,
247
+
and vice versa.
248
+
249
+
:doc:`Test utilities and fixtures <api/testing>` (:mod:`message_ix_models.testing`)
250
+
These are both low-level utilities and high-level tools
251
+
specifically to be used within the test suite.
252
+
They are *not* used anywhere besides :mod:`message_ix_models.tests`.
253
+
86
254
.. _policy-upstream-versions:
87
255
88
256
Upstream version policy
@@ -124,3 +292,32 @@ Python
124
292
- This indicates that the marked code relies on features only available in certain upstream versions (of one of the packages mentioned above, or another package), newer than those listed in `pyproject.toml <https://github.com/iiasa/message-ix-models/blob/main/pyproject.toml>`__.
125
293
- These minima **must** be mentioned in the :mod:`message_ix_models` documentation.
126
294
- Users wishing to use this marked code **must** use compatible versions of those packages.
295
+
296
+
.. _roadmap:
297
+
298
+
Roadmap
299
+
=======
300
+
301
+
The `message-ix-models Github repository <https://github.com/iiasa/message-ix-models>`_ hosts:
302
+
303
+
- `Current open issues <https://github.com/iiasa/message-ix-models/issues>`_,
304
+
arranged using many `labels <https://github.com/iiasa/message-ix-models/labels>`_.
305
+
- `Project boards <https://github.com/iiasa/message-ix-models/projects>`_ for ongoing efforts.
306
+
307
+
Documentation for particular submodules,
308
+
for instance :mod:`message_ix_models.model.material`,
309
+
may contain module- or project-specific roadmaps and change logs.
310
+
311
+
The same features are available for the private :mod:`message_data` repository:
0 commit comments