Commit b3cc8ef 1 parent b631b56 commit b3cc8ef Copy full SHA for b3cc8ef
File tree 3 files changed +43
-18
lines changed
3 files changed +43
-18
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,25 @@ General purpose modeling tools (:mod:`.tools`)
6
6
- Codes for retrieving data from specific data sources and adapting it for use with :mod: `message_ix_models `.
7
7
- Codes for modifying scenarios; although tools for building models should go in :mod: `message_ix_models.model `.
8
8
9
+ .. currentmodule :: message_ix_models.tools
10
+
9
11
On other pages:
10
12
11
13
- :doc: `tools-costs `
12
14
15
+ .. autosummary ::
16
+ :toctree: _autosummary
17
+ :template: autosummary-module.rst
18
+ :recursive:
19
+
20
+ res_marg
21
+
13
22
On this page:
14
23
15
24
.. contents ::
16
25
:local:
17
26
:backlinks: none
18
27
19
- .. currentmodule :: message_ix_models.tools
20
-
21
- .. automodule :: message_ix_models.tools
22
- :members:
23
-
24
28
.. currentmodule :: message_ix_models.tools.exo_data
25
29
26
30
Exogenous data (:mod: `.tools.exo_data `)
Original file line number Diff line number Diff line change
1
+ import pytest
2
+
3
+ from message_ix_models .tools .res_marg import main
4
+
5
+
6
+ @pytest .mark .xfail (reason = "Incomplete test" )
7
+ def test_cli () -> None :
8
+ # TODO Complete
9
+ assert False
10
+
11
+
12
+ @pytest .mark .xfail (reason = "Incomplete test" )
13
+ def test_main () -> None :
14
+ # TODO Complete
15
+ main ()
Original file line number Diff line number Diff line change
1
+ """Update the reserve margin."""
2
+
1
3
import argparse
4
+ from typing import TYPE_CHECKING
5
+
6
+ if TYPE_CHECKING :
7
+ from message_ix import Scenario
8
+
2
9
10
+ def main (scen : "Scenario" , contin : float = 0.2 ) -> None :
11
+ """Update the reserve margin.
12
+
13
+ For a given scenario, regional reserve margin (=peak load factor) values are updated
14
+ based on the electricity demand in the industry and res/comm sector.
3
15
4
- def main (scen , contin = 0.2 ):
5
- """Updates the reserve margin.
6
- For a given scenario, regional reserve margin (=peak load factor) values
7
- are updated based on the electricity demand in the industry and res/comm
8
- sector.
9
16
This is based on the approach described in Johnsonn et al. (2017):
10
- DOI: https://doi.org/10.1016/j.eneco.2016.07.010
11
- (see section 2.2.1. Firm capacity requirement)
17
+ DOI: https://doi.org/10.1016/j.eneco.2016.07.010 (see section 2.2.1. Firm capacity
18
+ requirement)
12
19
13
20
Parameters
14
21
----------
15
- scen : :class:`message_ix.Scenario`
16
- scenario to which changes should be applied
17
- contin : float
18
- Backup capacity for contingency reasons as percentage of peak capacity
19
- (default 20%)
22
+ scen :
23
+ Scenario to which changes should be applied.
24
+ contin :
25
+ Backup capacity for contingency reasons as percentage of peak capacity (default
26
+ 20%).
20
27
"""
21
-
22
28
demands = scen .par ("demand" )
23
29
demands = (
24
30
demands [demands .commodity .isin (["i_spec" , "rc_spec" ])]
You can’t perform that action at this time.
0 commit comments