Skip to content

Commit c94260a

Browse files
authored
Standardise column names in the documentation (#768)
* Standardise column names in the documentation * Update example models * Fix unit tests and small changes to documentation * Update tutorial models * Update notebooks * Update release notes * Update error messages
1 parent ebaf2b1 commit c94260a

381 files changed

Lines changed: 606 additions & 605 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/advanced-guide/extending-muse.ipynb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@
665665
],
666666
"metadata": {
667667
"kernelspec": {
668-
"display_name": "Python 3.8.2 ('.venv': venv)",
668+
"display_name": "muse_env",
669669
"language": "python",
670670
"name": "python3"
671671
},
@@ -679,12 +679,7 @@
679679
"name": "python",
680680
"nbconvert_exporter": "python",
681681
"pygments_lexer": "ipython3",
682-
"version": "3.12.4"
683-
},
684-
"vscode": {
685-
"interpreter": {
686-
"hash": "bef583514e26a7e735428d308331ee3372c412f577c9d62d7c3154d972034ba3"
687-
}
682+
"version": "3.12.11"
688683
}
689684
},
690685
"nbformat": 4,

docs/inputs/agents.rst

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ one agent per row, using a format meant specifically for retrofit and new-capaci
1010
For instance, we have the following CSV table:
1111

1212
.. csv-table::
13-
:header: Name, Type, AgentShare, RegionName, Objective1, SearchRule, DecisionMethod, ...
13+
:header: name, type, agent_share, region, objective1, search_rule, decision_method, ...
1414

1515
A1, New, Agent1New, ASEAN, EAC, all->maturity, epsilonCon, ...
1616
A2, New, Agent2New, ASEAN, CapitalCosts, all->spend_limit, weightedSum, ...
@@ -23,35 +23,35 @@ The columns have the following meaning:
2323

2424
.. _name:
2525

26-
``Name``
26+
``name``
2727
Name shared by a retrofit and new-capacity agent pair.
2828

29-
``Type``
29+
``type``
3030
One of **New** or **Retrofit**. **New** and **Retrofit** agents make up a pair with a given
31-
:ref:`name <Name>`. The demand is split into two, with one part coming from
31+
:ref:`name <name>`. The demand is split into two, with one part coming from
3232
decommissioned assets, and the other coming from everything else. "Retrofit" agents
3333
invest only to make up for decommissioned assets. They are often limited in the
34-
technologies they can consider (by :ref:`SearchRule <SearchRule>`). **New** agents
34+
technologies they can consider (by :ref:`search_rule <search_rule>`). **New** agents
3535
invest on the rest of the demand, and can often consider more general sets of
3636
technologies. If only **New** agents are included, they will also invest to make up for
3737
decommissioned assets, but the end mix might be different than using a specialised
3838
**Retrofit** agent for that.
3939
**Note: Retrofit agents will be deprecated in a future release.**
4040

41-
``AgentShare``
41+
``agent_share``
4242
Name used to assign a fraction of existing capacity to the agent in the :ref:`inputs-technodata` file.
4343
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,
4444
with values summing to 1 for each technology.
4545
If only using "New" agents, you should create a column with the name of each "New" agent share in the :ref:`inputs-technodata` file,
4646
with values summing to 1 for each technology.
4747
See documentation for the :ref:`inputs-technodata` file for more details.
4848

49-
``RegionName``
49+
``region``
5050
Region where an agent operates.
5151

5252
.. py:currentmodule:: muse.objectives
5353
54-
``Objective1``
54+
``objective1``
5555
Objective that an agent will try and maximize or minimize during investment.
5656
This objective should be one registered with
5757
:py:func:`@register_objective <register_objective>`. The following objectives are
@@ -91,32 +91,32 @@ The columns have the following meaning:
9191
- :py:func:`equivalent_annual_cost <equivalent_annual_cost>`: Annualized form of the
9292
net present value. Aliased to "EAC" for simplicity.
9393

94-
The weight associated with this objective can be changed using :ref:`ObjData1
95-
<ObjData1>`. Whether the objective should be minimized or maximized depends on
96-
:ref:`Objsort1 <Objsort1>`. Multiple objectives are combined using the
97-
:ref:`DecisionMethod <DecisionMethod>`
94+
The weight associated with this objective can be changed using ``obj_data1``.
95+
Whether the objective should be minimized or maximized depends on
96+
``obj_sort1``. Multiple objectives are combined using the
97+
:ref:`decision method <decision_method>`
9898

9999

100-
``ObjData1``
100+
``obj_data1``
101101
A weight associated with the objective.
102-
Whether it is used will depend in large part on the :ref:`decision method <DecisionMethod>`.
102+
Whether it is used will depend in large part on the :ref:`decision method <decision_method>`.
103103

104104

105-
``Objsort1``
105+
``obj_sort1``
106106
Determines whether the objective is maximized or minimized.
107107
This should be set to "True" for minimization and "False" for maximisation.
108108

109109
Additional objectives
110110
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.
111+
In this case, additional objectives can be specified with additional columns (e.g. ``objective2``, ``obj_data2``, ``obj_sort2`` etc.)
112+
For example, when using the weighted sum decision method, the ``obj_dataX`` column for each objective defines the weight of the objective in the weighted sum calculation.
113113

114114

115115
.. py:currentmodule:: muse.filters
116116
117-
.. _SearchRule:
117+
.. _search_rule:
118118

119-
``SearchRule``
119+
``search_rule``
120120
The search rule allows users to par down the search space of technologies to those an
121121
agent is likely to consider.
122122
The search rule is any function with a given signature, and registered with MUSE via
@@ -146,16 +146,15 @@ Additional objectives
146146
- :py:func:`maturity <maturity>`: Only allows technologies that have achieved a given
147147
market share.
148148

149-
- :py:func:`spend_limit <spend_limit>`: Only allows technologies with a unit capital cost (cap_par in
150-
:ref:`inputs-technodata`) lower than the spend limit.
149+
- :py:func:`spend_limit <spend_limit>`: Only allows technologies with a unit capital cost (cap_par in :ref:`inputs-technodata`) lower than the spend limit.
151150

152151
Filters can be combined by chaining them with "->". For example, "all->maturity->spend_limit".
153152

154153
.. py:currentmodule:: muse.decisions
155154
156-
.. _DecisionMethod:
155+
.. _decision_method:
157156

158-
``DecisionMethod``
157+
``decision_method``
159158
Decision methods reduce multiple objectives into a single scalar objective per
160159
replacement technology. They allow combining several objectives into a single metric
161160
through which replacement technologies can be ranked.
@@ -186,21 +185,21 @@ Additional objectives
186185
The functions allow for any number of objectives. However, the format described here
187186
allows only for three.
188187

189-
``Quantity``
188+
``quantity``
190189
Represents the fraction of new demand that is assigned to the agent
191190
(e.g. if 0.2, 20% of new demand in each year will be assigned to the agent).
192191
Must sum to 1 across all "New" agents.
193192
When using both "Retrofit" agents and "New" agents, this only applies to the "New" agents.
194193

195194
Additional optional columns
196-
Certain columns may also be required when using certain search rules. These are:
195+
Certain columns may also be required when using certain search rules. These are:
197196

198-
``MaturityThreshold``
199-
Only applies when using the :py:func:`maturity <muse.filters.maturity>` search rule.
200-
Allows agents to only consider technologies that have achieved a certain market share
201-
(e.g. if 0.5, the agent will only invest in technologies that have a current market share of 50% or more).
197+
``maturity_threshold``
198+
Only applies when using the :py:func:`maturity <muse.filters.maturity>` search rule.
199+
Allows agents to only consider technologies that have achieved a certain market share
200+
(e.g. if 0.5, the agent will only invest in technologies that have a current market share of 50% or more).
202201

203-
``SpendLimit``
204-
Only applies when using the :py:func:`spend_limit <muse.filters.spend_limit>` search rule.
205-
Allows agents to only consider technologies with a unit capital cost (`cap_par`) lower than the spend limit.
206-
(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).
202+
``spend_limit``
203+
Only applies when using the :py:func:`spend_limit <muse.filters.spend_limit>` search rule.
204+
Allows agents to only consider technologies with a unit capital cost (`cap_par`) lower than the spend limit.
205+
(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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ 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: CommodityName, Description, CommodityType, Unit
12+
:header: commodity, description, commodity_type, unit
1313

1414
hardcoal, Coal, Energy, PJ
1515
agires, Agricultural-residues, Energy, PJ
1616

17-
``CommodityName``
17+
``commodity``
1818
the internal name used for a commodity inside the model (e.g. "heat" or "elec").
1919
Any references to commodities in other files must use these names.
2020

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

24-
``CommodityType``
24+
``commodity_type``
2525
defines the type of a commodity:
2626

2727
The **energy** type includes energy commodities, such as biomass, electricity, gasoline, and hydrogen,
@@ -35,7 +35,7 @@ a whole are defined in a csv file with the following structure.
3535
The **environmental** type refers to non-energy commodities whichare used to quantify an impact on the environment,
3636
such as greenhouse gases or CO2. They can be subjected to different types of environmental fees or taxes.
3737

38-
``Unit`` (optional)
38+
``unit`` (optional)
3939
is the unit used to represent quantities of the commodity (e.g "PJ").
4040
This parameter does not need to be included, as it isn't used in the model, but is
4141
highly recommended for documentation purposes.

docs/inputs/commodities_io.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,32 @@ Below it is shown the generic structure of the input commodity file for the elec
4141
heater.
4242

4343
.. csv-table:: Commodities used as consumables - Input commodities
44-
:header: ProcessName, RegionName, Time, Level, electricity
44+
:header: technology, region, year, level, electricity
4545

4646
resBoilerElectric, region1, 2010, fixed, 300
4747
resBoilerElectric, region1, 2030, fixed, 290
4848

4949

50-
``ProcessName``
50+
``technology``
5151
represents the technology ID and needs to be consistent across all the data inputs.
5252

53-
``RegionName``
53+
``region``
5454
represents the region ID and needs to be consistent across all the data inputs.
5555

56-
``Time``
56+
``year``
5757
represents the period of the simulation to which the value applies; it needs to
5858
contain at least the base year of the simulation.
5959

60-
``Level`` (for **input** commodities only)
61-
characterises inputs as either "fixed" or "flexible".
60+
``level`` (for **input** commodities only)
61+
characterises inputs as either **fixed** or **flexible**.
6262
Fixed inputs are always used by a technology in a fixed proportion.
6363
Flexible inputs allow a technology to choose amongst several alternative fuels,
6464
depending on which one is cheapest at the time.
6565
For example, if a vehicle can use either petrodiesel or biodiesel, these
66-
should be specified as "flexible" inputs, and the technology will choose between
66+
should be specified as **flexible** inputs, and the technology will choose between
6767
them based on the price of each.
6868
If a process has a mix of fixed and flexible inputs, these should be split over two rows.
69-
Defaults to "fixed".
69+
Defaults to **fixed**.
7070

7171
Commodities (one column per commodity)
7272
Any further columns represent commodities, with names matching those

docs/inputs/correlation_files.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ An example of a shortened macrodriver file is shown below. This file contains th
2222
:widths: 50 50 50 25 25 25
2323
:header-rows: 1
2424

25-
* - Variable
26-
- RegionName
27-
- Unit
25+
* - variable
26+
- region
27+
- unit
2828
- 2010
2929
- 2011
3030
- ...
@@ -41,13 +41,13 @@ 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+
``region``
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

5353
Years (one column per year)
@@ -62,17 +62,17 @@ In the regression parameters file, it is necessary to state the parameters of th
6262
An example file is shown below:
6363

6464
.. csv-table:: Regression Parameters File
65-
:header: SectorName,FunctionType,Coeff,RegionName,electricity,gas,heat,CO2f
65+
:header: sector,function_type,coeff,region,electricity,gas,heat,CO2f
6666

6767
Residential,logistic-sigmoid,GDPexp,R1,0,0,9.94E-02,0
6868
Residential,logistic-sigmoid,constant,R1,0,0,0.0000434,0
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+
``sector``
7373
This is the sector name in which these parameters apply to.
7474

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

7878
- Exponential
@@ -85,10 +85,10 @@ An example file is shown below:
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+
``region``
9292
This is the region in which these parameters apply to.
9393

9494
Commodities (one column per commodity)
@@ -103,7 +103,7 @@ In this file, you are able to split the energy service proportionally by timesli
103103
An example file is shown below:
104104

105105
.. csv-table:: Timeslice share
106-
:header: SN,RegionName,electricity,gas,heat,CO2f,wind
106+
:header: timeslice,region,electricity,gas,heat,CO2f,wind
107107

108108
1,R1,0,0,0.034835,0,0
109109
2,R1,0,0,0.064546,0,0
@@ -112,10 +112,10 @@ 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+
``timeslice``
116116
This is the timeslice index.
117117

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

121121
Commodities (one column per commodity)

docs/inputs/existing_capacity.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ follow the structure reported in the table.
1212

1313

1414
.. csv-table:: Existing capacity of technologies: the residential boiler example
15-
:header: ProcessName, RegionName, 2010, 2020, 2030, 2040, 2050
15+
:header: technology, region, 2010, 2020, 2030, 2040, 2050
1616

1717
resBoilerElectric, region1, 5, 0.5, 0, 0, 0
1818
resBoilerElectric, region2, 39, 3.5, 1, 0.3, 0
1919

2020

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

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

2727
Years (one column per year)

docs/inputs/projections.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The interpretation of these prices depends on the type of commodity:
2828
The price trajectory should follow the structure shown in the table below.
2929

3030
.. csv-table:: Initial market projections
31-
:header: RegionName, Attribute, Time, com1, com2, com3
31+
:header: region, attribute, year, com1, com2, com3
3232

3333
region1, CommodityPrice, 2010, 20, 1.9583, 2
3434
region1, CommodityPrice, 2015, 20, 1.9583, 2
@@ -41,14 +41,14 @@ The price trajectory should follow the structure shown in the table below.
4141
region1, CommodityPrice, 2050, 22.85714286, 2.238057143, 2.285714286
4242

4343

44-
``RegionName``
44+
``region``
4545
represents the region ID and needs to be consistent across all the data inputs
4646

47-
``Attribute``
47+
``attribute``
4848
defines the attribute type. In this case it refers to the CommodityPrice; it is
4949
relevant only for internal use
5050

51-
``Time``
51+
``year``
5252
corresponds to the time periods of the simulation; the simulated time framework in
5353
the example goes from 2010 through to 2050 with a 5-year time step
5454

0 commit comments

Comments
 (0)