Skip to content

Commit b40b4bb

Browse files
committed
Add section 'requirements for processing modules'
1 parent 285c2b6 commit b40b4bb

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

scenario-databases.rst

+61-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,66 @@ The region-aggregation and validation is configured via a project-specific GitHu
8181
repository, usually named `https://github.com/iiasa/<project>-workflow`_. Please contact
8282
the respective project managers or the Scenario Services team if you need access.
8383

84+
The workflow for processing files uploaded via the IIASA Scenario Explorer
85+
is implemented in a modular fashion.
86+
This makes it straightforward to execute programs, code and tools developed
87+
by (non-IIASA) research partners as part of the processing workflow.
88+
89+
Requirements for processing modules
90+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91+
92+
Any module (a.k.a. program, code or tool) must adhere
93+
to the following standards of best-practice software development.
94+
The aim of these guidelines is to ensure reliability of our services,
95+
minimize maintenance requirements, and guarantee reproducibility of results
96+
across platforms.
97+
98+
General requirements
99+
````````````````````
100+
101+
- The program, code or tool must be implemented in Python (≥3.7) or R;
102+
compiled executables are not acceptable for security reasons
103+
- Distribution of the source code
104+
- via an online version-controlled repository
105+
(preferably GitHub) to which the IIASA admin team has access; or
106+
- installation via a package manager (pip, conda, CRAN).
107+
- The program must run on Debian (preferably Ubuntu)
108+
- The dependencies must be clearly stated,
109+
e.g. as Dockerfile (describing execution environment, library dependencies etc.)
110+
Python package dependencies according to packaging user guide (e.g. as environment.yml, requirements.txt etc.)
111+
R dependencies
112+
- The license must be clearly stated.
113+
- The documentation of the program, code or tool must include:
114+
- Purpose of the program and individual top-level functions
115+
- Instructions how to run the program
116+
- Expected input (variables, region mappings) and standard output
117+
- Explanation of any settings and optional parameters
118+
119+
Application programming interface
120+
`````````````````````````````````
121+
122+
**Option 1**:
123+
124+
The module is called via a command-line interface (CLI)
125+
and take the following arguments:
126+
127+
- :code:`input`: path to an IAMC-formatted file (:code:`xlsx` or :code:`csv`)
128+
- :code:`output`: path where to write an output file
129+
(usually derived timeseries data) in the same format
130+
- Any relevant settings and optional parameters must also be specified
131+
via the CLI
132+
133+
e.g. :code:`"python process.py --input path-to-input-file.xlsx --output path-to-output-file.xlsx"`
134+
135+
**Option 2** (applicable for packages/functions written in Python):
136+
137+
Importable Python functions that take and return :class:`pandas.DataFrame` (with columns
138+
folllowing the IAMC format) or :class:`pyam.IamDataFrame` objects can be called as part
139+
of the processing workflow. Any settings or optional parameters must be given as keyword
140+
arguments to the top-level function, preferably with the option to set them via a
141+
settings or configuration file.
142+
143+
84144
Executing scenario processing locally
85145
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86146

@@ -115,4 +175,4 @@ Read the `User Guide`_ of the **nomenclature** package for more information!
115175

116176
.. _`https://github.com/iiasa/<project>-workflow`: https://github.com/iiasa
117177

118-
.. _`User Guide`: https://nomenclature-iamc.readthedocs.io/en/stable/user_guide/local-usage.html
178+
.. _`User Guide`: https://nomenclature-iamc.readthedocs.io/en/stable/user_guide/local-usage.html

0 commit comments

Comments
 (0)