File tree Expand file tree Collapse file tree 3 files changed +43
-18
lines changed Expand file tree Collapse file tree 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`)
66- Codes for retrieving data from specific data sources and adapting it for use with :mod: `message_ix_models `.
77- Codes for modifying scenarios; although tools for building models should go in :mod: `message_ix_models.model `.
88
9+ .. currentmodule :: message_ix_models.tools
10+
911On other pages:
1012
1113- :doc: `tools-costs `
1214
15+ .. autosummary ::
16+ :toctree: _autosummary
17+ :template: autosummary-module.rst
18+ :recursive:
19+
20+ res_marg
21+
1322On this page:
1423
1524.. contents ::
1625 :local:
1726 :backlinks: none
1827
19- .. currentmodule :: message_ix_models.tools
20-
21- .. automodule :: message_ix_models.tools
22- :members:
23-
2428.. currentmodule :: message_ix_models.tools.exo_data
2529
2630Exogenous 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+
13import argparse
4+ from typing import TYPE_CHECKING
5+
6+ if TYPE_CHECKING :
7+ from message_ix import Scenario
8+
29
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.
315
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.
916 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)
1219
1320 Parameters
1421 ----------
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%).
2027 """
21-
2228 demands = scen .par ("demand" )
2329 demands = (
2430 demands [demands .commodity .isin (["i_spec" , "rc_spec" ])]
You can’t perform that action at this time.
0 commit comments