You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Trying a table format for release notes
* Fix links
* Remove toctree
* Trying a list instead
* Initial draft of release notes
* Add to index
* Improvements to release notes
* Improvements to settings documentation
Whether to control carbon budget undershoots. This parameter allows for carbon tax credit from one year to be passed to the next in the case of less carbon being emitted than the budget.
116
-
117
-
``control_overshoot`` (optional, default = False)
118
-
Whether to control carbon budget overshoots. If the amount of carbon emitted is above the carbon budget, this parameter specifies whether this deficit is carried over to the next year.
119
-
120
-
``method`` (optional, default = **bisection**)
121
-
Method used to equilibrate the carbon market. Available options are **fitting** and **bisection**, however this can be expanded with the `@register_carbon_budget_method` hook in `muse.carbon_budget`.
122
-
123
-
These methods solve the market with a number of different carbon prices, aiming to find the carbon price at which emissions (pooled across all regions) are equal to the carbon budget.
124
-
The obtained carbon price applies to all regions.
125
-
126
-
The **fitting** method samples a number of different carbon prices to build a regression model (linear or exponential) of emissions as a function of carbon price.
127
-
This regression model is then used to estimate the carbon price at which the carbon budget is met.
128
-
129
-
The **bisection** method uses an iterative approach to settle on a carbon price.
130
-
Starting with a lower and upper-bound carbon price, it iteratively halves this price interval until the carbon budget is met to within a user-defined tolerance, or until the maximum number of iterations is reached.
131
-
Generally, this method is more robust for markets with a complex, nonlinear relationship between emissions and carbon price, but may be slower to converge than the `fitting` method.
132
-
133
-
134
-
``method_options``
135
-
Additional options for the specified carbon method.
136
-
137
-
Parameters for the **bisection** method:
138
-
139
-
- ``max_iterations`` (optional, default = 5): maximum number of iterations.
140
-
- ``tolerance`` (optional, default = 0.1): tolerance for convergence. E.g. 0.1 means that the algorithm will terminate when emissions are within 10% of the carbon budget.
141
-
- ``early_termination_count`` (optional, default = 5): number of iterations with no change in the carbon price before the algorithm will terminate.
142
-
- ``price_penalty`` (optional, default = 0.1): penalty factor applied to carbon price when selecting optimal solution when convergence isn't reached. For example, if the carbon price is measured in units of MUSD/kt, a price penalty of 1000 means that a price increase of 1 MUSD/kt will only be accepted if it reduces emissions by at least 1000 kt.
143
-
144
-
Parameters for the **fitting** method:
145
-
146
-
- ``fitter`` (optional, default = **linear**): the regression model used to approximate model emissions. Predefined options are **linear** (default) and **exponential**. Further options can be defined using the `@register_carbon_budget_fitter` hook in `muse.carbon_budget`.
147
-
- ``sample_size`` (optional, default = 5): number of price samples used.
148
-
149
-
Shared parameters:
150
-
151
-
- ``refine_price`` (optional, default = False): If True, applies an upper limit on the carbon price.
152
-
- ``price_too_high_threshold`` (optional, default = 10): upper limit on the carbon price.
153
-
- ``resolution`` (optional, default = 2): Number of decimal places to solve the carbon price to. When using the bisection method, increasing this value may increase the time taken to solve the carbon market.
154
-
155
-
156
91
------------------
157
92
Global input files
158
93
------------------
@@ -180,12 +115,13 @@ Timeslices
180
115
----------
181
116
182
117
Time-slices represent a sub-year disaggregation of commodity demand. Generally,
183
-
timeslices are expected to introduce several levels, e.g. season, day, or hour. The
184
-
simplest is to show the TOML for the default timeslice:
118
+
timeslices are expected to introduce several levels, e.g. season, day, or hour.
119
+
For example:
185
120
186
121
.. code-block:: TOML
187
122
188
123
[timeslices]
124
+
level_names = ["month", "day", "hour"]
189
125
winter.weekday.night = 396
190
126
winter.weekday.morning = 396
191
127
winter.weekday.afternoon = 264
@@ -216,37 +152,17 @@ simplest is to show the TOML for the default timeslice:
216
152
summer.weekend.morning = 150
217
153
summer.weekend.afternoon = 150
218
154
summer.weekend.evening = 150
219
-
level_names = ["month", "day", "hour"]
220
155
221
-
This input introduces three levels, via ``level_names``: ``month``, ``day``, ``hours``.
222
-
Other simulations may want fewer or more levels. The ``month`` level is split into
223
-
three points of data, ``winter``, ``spring-autumn``, ``summer``. Then ``day`` splits out
156
+
This input introduces three levels, via ``level_names``: **month**, **day**, **hour**.
157
+
Other simulations may want fewer or more levels. The **month** level is split into
158
+
three points of data, *winter*, *spring-autumn*, *summer*. Then **day** splits out
224
159
weekdays from weekends, and so on. Each line indicates the number of hours for the
225
160
relevant slice. It should be noted that the slices are not a cartesian products of each
226
-
levels. For instance, there no ``peak`` periods during weekends. All that matters is
161
+
levels. For instance, there no *peak* periods during weekends. All that matters is
227
162
that the relative weights (i.e. the number of hours) are consistent and sum up to a
228
163
year.
229
164
230
165
231
-
-------------
232
-
Output cache
233
-
-------------
234
-
235
-
``outputs_cache``
236
-
This option behaves exactly like `outputs` for sectors and accepts the same options but
237
-
controls the output of cached quantities instead. This option is NOT available for
238
-
sectors themselves (i.e using `[[sector.commercial.outputs_cache]]` will have no effect). See
@@ -265,8 +181,6 @@ Above, we've added two sectors, residential and power. The name of the subsectio
265
181
only used for identification. In other words, it should be chosen to be meaningful to
266
182
the user, since it will not affect the model itself.
267
183
268
-
Sectors are defined in :py:class:`~muse.sectors.Sector`.
269
-
270
184
A sector accepts these attributes:
271
185
272
186
.. _sector-type:
@@ -472,6 +386,12 @@ Sectors contain a number of subsections:
472
386
If `False` MUSE will issue an error and abort, instead of
473
387
overwriting an existing file. This prevents important output files from being overwritten.
474
388
389
+
Additional sink parameters
390
+
You can pass additional parameters that will be forwarded to the underlying save function.
391
+
For example, when using the "csv" sink, you could use `float_format = "%.6f"` to increase the precision of floating point numbers in the output file (default is 4 decimal places).
392
+
For a complete list of available parameters, see the documentation for the respective save function (e.g., `pandas.to_csv <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html>`_ for CSV outputs).
393
+
394
+
475
395
For example, the following would save supply data for the commercial sector as a separate file for each year:
476
396
477
397
.. code-block:: TOML
@@ -492,14 +412,7 @@ Sectors contain a number of subsections:
Note that the aggregate sink always overwrites the final file, since it will
496
-
overwrite itself.
497
-
498
-
**Additional sink parameters:**
499
-
500
-
You can pass additional parameters that will be forwarded to the underlying save function.
501
-
For example, when using the "csv" sink, you could use `float_format = "%.6f"` to increase the precision of floating point numbers in the output file (default is 4 decimal places).
502
-
For a complete list of available parameters, see the documentation for the respective save function (e.g., `pandas.to_csv <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html>`_ for CSV outputs).
415
+
Note that the aggregate sink always overwrites the final file, since it will overwrite itself.
503
416
504
417
505
418
``interactions`` (optional)
@@ -562,8 +475,6 @@ The commodity production, commodity consumption and product prices of preset sec
562
475
exogeneously. They are know from the start of the simulation and are not affected by the
563
476
simulation.
564
477
565
-
Preset sectors are defined in :py:class:`~muse.sectors.PresetSector`.
566
-
567
478
A common example would be the following, where commodity consumption is defined exogeneously:
568
479
569
480
.. code-block:: TOML
@@ -619,10 +530,6 @@ The following attributes are accepted:
619
530
CSV file, one per year, indicating the amount of commodities produced. It follows
620
531
the same format as :ref:`consumption_path <preset-consumption>`.
621
532
622
-
``prices_path``
623
-
CSV file indicating the amount of a commodities produced. The format of the CSV files
624
-
follows that of :ref:`inputs-projection`.
625
-
626
533
.. _preset-demand:
627
534
628
535
``demand_path``
@@ -653,11 +560,89 @@ The following attributes are accepted:
653
560
Requires
654
561
:ref:`macrodrivers_path<preset-consumption>`.
655
562
656
-
``filters``
657
-
Optional dictionary of entries by which to filter the consumption. Requires
658
-
:ref:`macrodrivers_path<preset-consumption>`. For instance,
659
563
660
-
.. code-block::
564
+
-------------
565
+
Carbon market (optional)
566
+
-------------
567
+
568
+
This section contains the settings related to the modelling of the carbon market.
569
+
If omitted, it defaults to not including the carbon market in the simulation.
570
+
571
+
For example
572
+
573
+
.. code-block:: TOML
574
+
575
+
[carbon_budget_control]
576
+
budget = [1000, 800, 600, 400, 200, 0]
577
+
commodities = ["CO2"]
578
+
579
+
``budget``
580
+
Yearly budget. There should be one item for each year the simulation will run. In
581
+
other words, if given and not empty, this is a list with the same length as
582
+
`time_framework` from the main section. If not given or an empty list, then the
583
+
carbon market feature is disabled. Defaults to an empty list.
Whether to control carbon budget undershoots. This parameter allows for carbon tax credit from one year to be passed to the next in the case of less carbon being emitted than the budget.
590
+
591
+
``control_overshoot`` (optional, default = False)
592
+
Whether to control carbon budget overshoots. If the amount of carbon emitted is above the carbon budget, this parameter specifies whether this deficit is carried over to the next year.
593
+
594
+
``method`` (optional, default = **bisection**)
595
+
Method used to equilibrate the carbon market. Available options are **fitting** and **bisection**, however this can be expanded with the `@register_carbon_budget_method` hook in `muse.carbon_budget`.
596
+
597
+
These methods solve the market with a number of different carbon prices, aiming to find the carbon price at which emissions (pooled across all regions) are equal to the carbon budget.
598
+
The obtained carbon price applies to all regions.
599
+
600
+
The **fitting** method samples a number of different carbon prices to build a regression model (linear or exponential) of emissions as a function of carbon price.
601
+
This regression model is then used to estimate the carbon price at which the carbon budget is met.
602
+
603
+
The **bisection** method uses an iterative approach to settle on a carbon price.
604
+
Starting with a lower and upper-bound carbon price, it iteratively halves this price interval until the carbon budget is met to within a user-defined tolerance, or until the maximum number of iterations is reached.
605
+
Generally, this method is more robust for markets with a complex, nonlinear relationship between emissions and carbon price, but may be slower to converge than the `fitting` method.
606
+
607
+
608
+
``method_options``
609
+
Additional options for the specified carbon method.
610
+
611
+
Parameters for the **bisection** method:
612
+
613
+
- ``max_iterations`` (optional, default = 5): maximum number of iterations.
614
+
- ``tolerance`` (optional, default = 0.1): tolerance for convergence. E.g. 0.1 means that the algorithm will terminate when emissions are within 10% of the carbon budget.
615
+
- ``early_termination_count`` (optional, default = 5): number of iterations with no change in the carbon price before the algorithm will terminate.
616
+
- ``price_penalty`` (optional, default = 0.1): penalty factor applied to carbon price when selecting optimal solution when convergence isn't reached. For example, if the carbon price is measured in units of MUSD/kt, a price penalty of 1000 means that a price increase of 1 MUSD/kt will only be accepted if it reduces emissions by at least 1000 kt.
617
+
618
+
Parameters for the **fitting** method:
619
+
620
+
- ``fitter`` (optional, default = **linear**): the regression model used to approximate model emissions. Predefined options are **linear** (default) and **exponential**. Further options can be defined using the `@register_carbon_budget_fitter` hook in `muse.carbon_budget`.
621
+
- ``sample_size`` (optional, default = 5): number of price samples used.
622
+
623
+
Shared parameters:
624
+
625
+
- ``refine_price`` (optional, default = False): If True, applies an upper limit on the carbon price.
626
+
- ``price_too_high_threshold`` (optional, default = 10): upper limit on the carbon price.
627
+
- ``resolution`` (optional, default = 2): Number of decimal places to solve the carbon price to. When using the bisection method, increasing this value may increase the time taken to solve the carbon market.
628
+
629
+
630
+
631
+
-------------
632
+
Output cache (for advanced users)
633
+
-------------
634
+
635
+
``outputs_cache``
636
+
This option behaves exactly like `outputs` for sectors and accepts the same options but
637
+
controls the output of cached quantities instead. This option is NOT available for
638
+
sectors themselves (i.e using `[[sector.commercial.outputs_cache]]` will have no effect). See
The most significant change in this release is a substantial improvement to the code that reads MUSE input files.
8
+
From a developer perspective, these changes greatly improve maintainability and ease of future feature addition.
9
+
In addition, these changes have several implcations for users designed to improve the overall experience of working with MUSE.
10
+
11
+
Some of the main changes for users are as follows:
12
+
13
+
- Generally improved error messages.
14
+
- Units rows and columns are no longer required. In general, users should only include units in the global commodities file, and a currency unit in the settings file (see below). All other parameter units can be inferred based on these, and it's up to the user to ensure that units are consistent.
15
+
- Several previously mandatory parameters are now optional, with default values specified in the documentation. For example, capital costs, variable cost and fixed cost parameters are now optional, defaulting to a cost of zero and an exponent of 1. I cannot list all parameters here, so you are encouraged to look at the documentation yourself.
16
+
- Commodity input/output and price projections files no longer require columns for all commodities. Values for missing commodities will default to zero.
17
+
18
+
You are encouraged to look at the new documentation [here](https://muse-os.readthedocs.io/en/v1.4.3/inputs/index.html), as well as the [tutorials](https://muse-os.readthedocs.io/en/v1.4.3/user-guide/index.html).
19
+
20
+
The example models have been simplified in line with these changes (for example, compare the default model [here](https://github.com/EnergySystemsModellingLab/MUSE_OS/tree/v1.5.0/src/muse/data/example/default), to the previous version [here](https://github.com/EnergySystemsModellingLab/MUSE_OS/tree/v1.4.3/src/muse/data/example/default)).
21
+
22
+
The core changes to the code can be found in: {github}`724`, {github}`746`, {github}`749`, {github}`750`
23
+
24
+
## Added a `currency` parameter to the settings file ({github}`740`)
25
+
26
+
Allows users to specify a single currency that all monetary parameters must be expressed in (e.g "USD").
27
+
This can be whatever you like, and will not be directly used in the model, but is useful for documentation purposes and will also be outputted along with the commodity prices results, as long as commodity units are also defined.
28
+
See documentation for the parameter [here](https://muse-os.readthedocs.io/en/latest/inputs/toml.html#main-section).
29
+
30
+
## Fixed an issue where commodity prices of zero were not included in the output ({github}`738`)
31
+
32
+
Prices output files will now include rows for commodities that have a price of zero, which were previously omitted.
33
+
This is to remove potential pitfalls when plotting prices (see {github}`734`).
34
+
35
+
## Fixed bugs with flexible inputs ({github}`755`)
36
+
37
+
Users trying to use flexible inputs in previous versions would have run into problems, as this was a poorly tested feature with some implementation bugs. These are now fixed.
0 commit comments