Skip to content

Commit f2c6c2f

Browse files
authored
Clean up documentation for input files (#761)
* Clean up documentation for input files * Update settings documentation * Further adjustments * Add horizontal lines to break up page * Add extra details to close issues * Remove incorrect parameter
1 parent 6683190 commit f2c6c2f

9 files changed

Lines changed: 358 additions & 390 deletions

docs/inputs/agents.rst

Lines changed: 31 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@
44
Agents
55
======
66

7-
In MUSE, an agent-based formulation was originally introduced for the residential and
8-
commercial building sectors (`Sachs et al. (2019) <https://doi.org/10.1016/j.energy.2019.01.161>`_). Agents are defined using a CSV file, with
9-
one agent per row, using a format meant specifically for retrofit
10-
and new-capacity agent pairs. This CSV file can be read using
11-
:py:func:`~muse.readers.csv.read_agent_parameters`. The data is also
12-
interpreted to some degree in the factory functions
13-
:py:func:`~muse.agent.create_retrofit_agent` and
14-
:py:func:`~muse.agent.create_newcapa_agent`.
7+
Agents are defined using a CSV file, with
8+
one agent per row, using a format meant specifically for retrofit and new-capacity agent pairs.
159

1610
For instance, we have the following CSV table:
1711

@@ -29,38 +23,36 @@ The columns have the following meaning:
2923

3024
.. _name:
3125

32-
Name
26+
``Name``
3327
Name shared by a retrofit and new-capacity agent pair.
3428

35-
Type
36-
One of "New" or "Retrofit". "New" and "Retrofit" agents make up a pair with a given
29+
``Type``
30+
One of **New** or **Retrofit**. **New** and **Retrofit** agents make up a pair with a given
3731
:ref:`name <Name>`. The demand is split into two, with one part coming from
3832
decommissioned assets, and the other coming from everything else. "Retrofit" agents
3933
invest only to make up for decommissioned assets. They are often limited in the
40-
technologies they can consider (by :ref:`SearchRule <SearchRule>`). "New" agents
34+
technologies they can consider (by :ref:`SearchRule <SearchRule>`). **New** agents
4135
invest on the rest of the demand, and can often consider more general sets of
42-
technologies. If only "New" agents are included, they will also invest to make up for
36+
technologies. If only **New** agents are included, they will also invest to make up for
4337
decommissioned assets, but the end mix might be different than using a specialised
44-
"Retrofit" agent for that.
45-
*Note: Retrofit agents will be deprecated in a future release.*
38+
**Retrofit** agent for that.
39+
**Note: Retrofit agents will be deprecated in a future release.**
4640

47-
AgentShare
41+
``AgentShare``
4842
Name used to assign a fraction of existing capacity to the agent in the :ref:`inputs-technodata` file.
4943
If using "New" and "Retrofit" agents, you should create a column with the name of each "Retrofit" agent share (e.g. "Agent1Retro", "Agent2Retro" etc.) in the :ref:`inputs-technodata` file,
5044
with values summing to 1 for each technology.
5145
If only using "New" agents, you should create a column with the name of each "New" agent share in the :ref:`inputs-technodata` file,
5246
with values summing to 1 for each technology.
5347
See documentation for the :ref:`inputs-technodata` file for more details.
5448

55-
RegionName
49+
``RegionName``
5650
Region where an agent operates.
5751

5852
.. py:currentmodule:: muse.objectives
5953
60-
.. _Objective1:
61-
62-
Objective1
63-
First objective that an agent will try and maximize or minimize during investment.
54+
``Objective1``
55+
Objective that an agent will try and maximize or minimize during investment.
6456
This objective should be one registered with
6557
:py:func:`@register_objective <register_objective>`. The following objectives are
6658
available with MUSE:
@@ -104,50 +96,27 @@ Objective1
10496
:ref:`Objsort1 <Objsort1>`. Multiple objectives are combined using the
10597
:ref:`DecisionMethod <DecisionMethod>`
10698

107-
.. _Objective2:
108-
109-
Objective2 (optional)
110-
Second objective. See :ref:`Objective1 <Objective1>`.
111-
112-
.. _Objective3:
113-
114-
Objective3 (optional)
115-
Third objective. See :ref:`Objective1 <Objective1>`.
11699

117-
.. _ObjData1:
100+
``ObjData1``
101+
A weight associated with the objective.
102+
Whether it is used will depend in large part on the :ref:`decision method <DecisionMethod>`.
118103

119-
ObjData1
120-
A weight associated with the :ref:`first objective <Objective1>`. Whether it is used
121-
will depend in large part on the :ref:`decision method <DecisionMethod>`.
122104

123-
ObjData2 (optional)
124-
A weight associated with the :ref:`second objective <Objective2>`. See :ref:`ObjData1
125-
<ObjData1>`.
105+
``Objsort1``
106+
Determines whether the objective is maximized or minimized.
107+
This should be set to "True" for minimization and "False" for maximisation.
126108

127-
ObjData3 (optional)
128-
A weight associated with the :ref:`third objective <Objective3>`. See :ref:`ObjData1
129-
<ObjData1>`.
109+
Additional objectives
110+
For certain decision methods you can use more than one objective.
111+
In this case, additional objectives can be specified with additional columns (e.g. ``Objective2``, ``ObjData2``, ``Objsort2`` etc.)
112+
For example, when using the weighted sum decision method, the ``ObjDataX`` column for each objective defines the weight of the objective in the weighted sum calculation.
130113

131-
.. _Objsort1:
132-
133-
Objsort1
134-
Sets whether :ref:`first objective <Objective1>` is maximized or minimized. For both
135-
"adhoc" and "scipy" solvers this should be set to "True" for minimization and
136-
"False" for maximisation.
137-
138-
Objsort2 (optional)
139-
Objsort parameter for :ref:`second objective <Objective2>`. See :ref:`Objsort1
140-
<Objsort1>`.
141-
142-
Objsort3 (optional)
143-
Objsort parameter for :ref:`third objective <Objective3>`. See :ref:`Objsort1
144-
<Objsort1>`.
145114

146115
.. py:currentmodule:: muse.filters
147116
148117
.. _SearchRule:
149118

150-
SearchRule
119+
``SearchRule``
151120
The search rule allows users to par down the search space of technologies to those an
152121
agent is likely to consider.
153122
The search rule is any function with a given signature, and registered with MUSE via
@@ -186,7 +155,7 @@ SearchRule
186155
187156
.. _DecisionMethod:
188157

189-
DecisionMethod
158+
``DecisionMethod``
190159
Decision methods reduce multiple objectives into a single scalar objective per
191160
replacement technology. They allow combining several objectives into a single metric
192161
through which replacement technologies can be ranked.
@@ -217,18 +186,21 @@ DecisionMethod
217186
The functions allow for any number of objectives. However, the format described here
218187
allows only for three.
219188

220-
Quantity
189+
``Quantity``
221190
Represents the fraction of new demand that is assigned to the agent
222191
(e.g. if 0.2, 20% of new demand in each year will be assigned to the agent).
223192
Must sum to 1 across all "New" agents.
224193
When using both "Retrofit" agents and "New" agents, this only applies to the "New" agents.
225194

226-
MaturityThreshold (optional)
195+
Additional optional columns
196+
Certain columns may also be required when using certain search rules. These are:
197+
198+
``MaturityThreshold``
227199
Only applies when using the :py:func:`maturity <muse.filters.maturity>` search rule.
228200
Allows agents to only consider technologies that have achieved a certain market share
229201
(e.g. if 0.5, the agent will only invest in technologies that have a current market share of 50% or more).
230202

231-
SpendLimit (optional)
203+
``SpendLimit``
232204
Only applies when using the :py:func:`spend_limit <muse.filters.spend_limit>` search rule.
233205
Allows agents to only consider technologies with a unit capital cost (`cap_par`) lower than the spend limit.
234206
(e.g. if 10, the agent will only invest in technologies with a `cap_par` of 10 or lower, as listed in the :ref:`inputs-technodata` file).

docs/inputs/commodities.rst

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,38 @@ represent energy, services, pollutants/emissions. The commodities for the simula
99
a whole are defined in a csv file with the following structure.
1010

1111
.. csv-table:: Global commodities
12-
:header: Commodity, CommodityType, CommodityName, CommodityEmissionFactor_CO2, HeatRate, Unit
12+
:header: CommodityName, Description, CommodityType, Unit
1313

14+
hardcoal, Coal, Energy, PJ
15+
agires, Agricultural-residues, Energy, PJ
1416

15-
Coal, Energy, hardcoal, 94.6, 29, PJ
16-
Agricultural-residues, Energy, agrires, 112, 15.4, PJ
17-
18-
CommodityName
17+
``CommodityName``
1918
the internal name used for a commodity inside the model (e.g. "heat" or "elec").
2019
Any references to commodities in other files must use these names.
2120

22-
Description
21+
``Description`` (optional)
2322
an extended name/description of a commodity (e.g. "Heating" or "Electricity").
2423

25-
CommodityType
26-
defines the type of a commodity (i.e. Energy, Service, Material, or Environmental).
24+
``CommodityType``
25+
defines the type of a commodity:
2726

28-
The "energy" type includes energy commodities, such as biomass, electricity, gasoline, and hydrogen,
27+
The **energy** type includes energy commodities, such as biomass, electricity, gasoline, and hydrogen,
2928
which are either extracted, transformed from one to another, or used in the energy system.
3029

31-
The "service" type includes commodities such as space heating or hot water which correspond to selected
30+
The **service** type includes commodities such as space heating or hot water which correspond to selected
3231
people's needs, and whose fulfillment requires energy uses.
3332

34-
The "material" type represent non-energy inputs for energy technologies, such as limestone or oxygen.
33+
The **material** type represent non-energy inputs for energy technologies, such as limestone or oxygen.
3534

36-
The "environmental" type refers to non-energy commodities whichare used to quantify an impact on the environment,
35+
The **environmental** type refers to non-energy commodities whichare used to quantify an impact on the environment,
3736
such as greenhouse gases or CO2. They can be subjected to different types of environmental fees or taxes.
3837

39-
Unit (optional)
38+
``Unit`` (optional)
4039
is the unit used to represent quantities of the commodity (e.g "PJ").
41-
This parameter does not need to be included, as it isn't used in the model, but care should be taken to ensure that units are consistent across all input files.
40+
This parameter does not need to be included, as it isn't used in the model, but is
41+
highly recommended for documentation purposes.
42+
In any case, care should be taken to ensure that units are consistent across all input files.
43+
44+
Additional optional columns
45+
Users can provide additional columns for extra information about the commodity (e.g. ``heat_rate``).
46+
These will be ignored by the model, but can be useful for documentation purposes.

docs/inputs/commodities_io.rst

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
.. _inputs-iocomms:
22

33
=================
4-
Commodities
4+
Commodity inputs/outputs
55
=================
66

7-
Input
7+
**Input**
88

99
Input commodities are the commodities consumed by each
1010
technology. They are defined in a csv file which describes the commodity inputs to each
11-
technology, calculated per unit of technology activity, Where the unit is defined by the user (e.g. petajoules).
12-
13-
Output
11+
technology, calculated per unit of technology activity.
1412

13+
**Output**
1514

1615
Output commodities are the commodities produced by each
1716
technology. They are defined in a csv file which describes the commodity outputs from
@@ -20,11 +19,10 @@ each technology, defined per unit of technology activity. Emissions, such as CO2
2019
for in this file.
2120

2221

23-
General features
24-
22+
**General features**
2523

26-
To illustrate the data required for a generic technology in MUSE, the *electric boiler
27-
technology* is used as an example. The commodity flow for the electric boiler, capable
24+
To illustrate the data required for a generic technology in MUSE, the *electric boiler*
25+
technology is used as an example. The commodity flow for the electric boiler, capable
2826
to cover space heating and water heating energy service demands.
2927

3028
.. figure:: commodities_io.png
@@ -49,17 +47,17 @@ heater.
4947
resBoilerElectric, region1, 2030, fixed, 290
5048

5149

52-
ProcessName
50+
``ProcessName``
5351
represents the technology ID and needs to be consistent across all the data inputs.
5452

55-
RegionName
53+
``RegionName``
5654
represents the region ID and needs to be consistent across all the data inputs.
5755

58-
Time
56+
``Time``
5957
represents the period of the simulation to which the value applies; it needs to
6058
contain at least the base year of the simulation.
6159

62-
Level (for **input** commodities only)
60+
``Level`` (for **input** commodities only)
6361
characterises inputs as either "fixed" or "flexible".
6462
Fixed inputs are always used by a technology in a fixed proportion.
6563
Flexible inputs allow a technology to choose amongst several alternative fuels,
@@ -70,10 +68,17 @@ Level (for **input** commodities only)
7068
If a process has a mix of fixed and flexible inputs, these should be split over two rows.
7169
Defaults to "fixed".
7270

73-
The remaining columns should contain the full list of commodities.
74-
71+
Commodities (one column per commodity)
72+
Any further columns represent commodities, with names matching those
73+
defined in the global commodities file.
74+
The values in these columns represent the quantity of the commodity consumed or produced by the technology per unit of activity.
75+
You do not need to specify all commodities,
76+
only those that are consumed or produced by the technologies in the sector
7577

78+
--------------------------------
7679

77-
The input data has to be provided for the base year. Additional years within the time
78-
framework of the overall simulation can be defined. In this case, MUSE would interpolate
79-
the values between the provided periods and assume a constant value afterwards.
80+
The input data has to be provided for the base year, after which MUSE will assume
81+
that values are constant for all subsequent years, if no further data is provided.
82+
If users wish to vary parameters by year, they can provide rows for additional years.
83+
In this case, MUSE would interpolate the values between the provided periods and assume
84+
a constant value afterwards.

docs/inputs/correlation_files.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ An example of a shortened macrodriver file is shown below. This file contains th
4141
- 81.82599
4242
- ...
4343

44-
Variable
44+
``Variable``
4545
This is the variable that you would like to use in the regression for the service demand.
4646

47-
RegionName
47+
``RegionName``
4848
This is the region that the data applies to. This must correlate with the regions set in the rest of your input files, as well as the toml file.
4949

50-
Unit
50+
``Unit``
5151
This unit can be whatever you like, however they must be consistent across all input files.
5252

53-
2010, 2011, ...
53+
Years (one column per year)
5454
This is the quantity of the variable per year of the simulation.
5555

5656

@@ -69,10 +69,10 @@ An example file is shown below:
6969
Residential,logistic-sigmoid,GDPscaleLess,R1,0,0,753.1068725,0
7070
Residential,logistic-sigmoid,GDPscaleGreater,R1,0,0,672.9316672,0
7171

72-
SectorName
72+
``SectorName``
7373
This is the sector name in which these parameters apply to.
7474

75-
FunctionType
75+
``FunctionType``
7676
This is the function type you would like to MUSE to use. MUSE allows these to be:
7777

7878
- Exponential
@@ -85,13 +85,13 @@ FunctionType
8585

8686
Your own functions can be created using the `@register_regression` hook, from the `regressions.py` file.
8787

88-
Coeff
88+
``Coeff``
8989
This is the coefficient for the respective function type. These are explicitly defined within the `regressions.py` file, as they differ between functions.
9090

91-
RegionName
91+
``RegionName``
9292
This is the region in which these parameters apply to.
9393

94-
Energy service (electricity, gas, heat, CO2f)
94+
Commodities (one column per commodity)
9595
Here you can specify the coefficients for the expected demand for the respective commodity.
9696

9797

@@ -112,11 +112,11 @@ An example file is shown below:
112112
5,R1,0,0,0.014145,0,0
113113
6,R1,0,0,0.085783,0,0
114114

115-
SN
115+
``SN``
116116
This is the timeslice index.
117117

118-
RegionName
118+
``RegionName``
119119
This is the region in question for this data.
120120

121-
Energy service (electricity, gas, heat, CO2f, wind)
121+
Commodities (one column per commodity)
122122
Here you specify the proportion of each energy service for each timeslice.

docs/inputs/existing_capacity.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ follow the structure reported in the table.
1818
resBoilerElectric, region2, 39, 3.5, 1, 0.3, 0
1919

2020

21-
ProcessName
21+
``ProcessName``
2222
represents the technology ID and needs to be consistent across all the data inputs.
2323

24-
RegionName
24+
``RegionName``
2525
represents the region ID and needs to be consistent across all the data inputs.
2626

27-
2010,..., 2050
27+
Years (one column per year)
2828
represent the simulated periods.

0 commit comments

Comments
 (0)