Skip to content

Commit f98cd0f

Browse files
authored
Release notes v1.5 (#766)
* 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
1 parent 8452ab5 commit f98cd0f

4 files changed

Lines changed: 137 additions & 123 deletions

File tree

docs/inputs/inputs_csv.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,11 @@ This section details the CSV files that are used to populate the simulation data
88
:maxdepth: 1
99
:caption: Contents:
1010

11-
projections
1211
commodities
12+
projections
1313
technodata
1414
technodata_timeslices
1515
commodities_io
1616
existing_capacity
1717
agents
1818
correlation_files
19-
20-
21-
Indices and tables
22-
------------------
23-
24-
25-
- :ref:`genindex`
26-
- :ref:`modindex`
27-
- :ref:`search`

docs/inputs/toml.rst

Lines changed: 98 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -88,71 +88,6 @@ a whole.
8888
such as :py:meth:`~muse.outputs.register_output_quantity`.
8989

9090

91-
-------------
92-
Carbon market (optional)
93-
-------------
94-
95-
This section contains the settings related to the modelling of the carbon market.
96-
If omitted, it defaults to not including the carbon market in the simulation.
97-
98-
Example
99-
100-
.. code-block:: TOML
101-
102-
[carbon_budget_control]
103-
budget = []
104-
105-
``budget``
106-
Yearly budget. There should be one item for each year the simulation will run. In
107-
other words, if given and not empty, this is a list with the same length as
108-
`time_framework` from the main section. If not given or an empty list, then the
109-
carbon market feature is disabled. Defaults to an empty list.
110-
111-
``commodities``
112-
Commodities that make up the carbon market.
113-
114-
``control_undershoot`` (optional, default = False)
115-
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-
15691
------------------
15792
Global input files
15893
------------------
@@ -180,12 +115,13 @@ Timeslices
180115
----------
181116

182117
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:
185120

186121
.. code-block:: TOML
187122
188123
[timeslices]
124+
level_names = ["month", "day", "hour"]
189125
winter.weekday.night = 396
190126
winter.weekday.morning = 396
191127
winter.weekday.afternoon = 264
@@ -216,37 +152,17 @@ simplest is to show the TOML for the default timeslice:
216152
summer.weekend.morning = 150
217153
summer.weekend.afternoon = 150
218154
summer.weekend.evening = 150
219-
level_names = ["month", "day", "hour"]
220155
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
224159
weekdays from weekends, and so on. Each line indicates the number of hours for the
225160
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
227162
that the relative weights (i.e. the number of hours) are consistent and sum up to a
228163
year.
229164

230165

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
239-
:py:mod:`muse.outputs.cache` for more details.
240-
241-
A single row looks like this:
242-
243-
.. code-block:: TOML
244-
245-
[[outputs_cache]]
246-
quantity = "production"
247-
sink = "aggregate"
248-
filename = "{cwd}/{default_output_dir}/Cache{Quantity}.csv"
249-
250166
----------------
251167
Standard sectors
252168
----------------
@@ -265,8 +181,6 @@ Above, we've added two sectors, residential and power. The name of the subsectio
265181
only used for identification. In other words, it should be chosen to be meaningful to
266182
the user, since it will not affect the model itself.
267183

268-
Sectors are defined in :py:class:`~muse.sectors.Sector`.
269-
270184
A sector accepts these attributes:
271185

272186
.. _sector-type:
@@ -472,6 +386,12 @@ Sectors contain a number of subsections:
472386
If `False` MUSE will issue an error and abort, instead of
473387
overwriting an existing file. This prevents important output files from being overwritten.
474388

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+
475395
For example, the following would save supply data for the commercial sector as a separate file for each year:
476396

477397
.. code-block:: TOML
@@ -492,14 +412,7 @@ Sectors contain a number of subsections:
492412
sink = "aggregate"
493413
filename = "{cwd}/{default_output_dir}/{Sector}/{Quantity}.csv"
494414
495-
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.
503416

504417

505418
``interactions`` (optional)
@@ -562,8 +475,6 @@ The commodity production, commodity consumption and product prices of preset sec
562475
exogeneously. They are know from the start of the simulation and are not affected by the
563476
simulation.
564477

565-
Preset sectors are defined in :py:class:`~muse.sectors.PresetSector`.
566-
567478
A common example would be the following, where commodity consumption is defined exogeneously:
568479

569480
.. code-block:: TOML
@@ -619,10 +530,6 @@ The following attributes are accepted:
619530
CSV file, one per year, indicating the amount of commodities produced. It follows
620531
the same format as :ref:`consumption_path <preset-consumption>`.
621532

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-
626533
.. _preset-demand:
627534

628535
``demand_path``
@@ -653,11 +560,89 @@ The following attributes are accepted:
653560
Requires
654561
:ref:`macrodrivers_path<preset-consumption>`.
655562

656-
``filters``
657-
Optional dictionary of entries by which to filter the consumption. Requires
658-
:ref:`macrodrivers_path<preset-consumption>`. For instance,
659563

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.
661584

662-
filters.region = ["USA", "ASEA"]
663-
filters.commodity = ["algae", "fluorescent light"]
585+
``commodities``
586+
Commodities that make up the carbon market.
587+
588+
``control_undershoot`` (optional, default = False)
589+
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
639+
:py:mod:`muse.outputs.cache` for more details.
640+
641+
A single row looks like this:
642+
643+
.. code-block:: TOML
644+
645+
[[outputs_cache]]
646+
quantity = "production"
647+
sink = "aggregate"
648+
filename = "{cwd}/{default_output_dir}/Cache{Quantity}.csv"

docs/release-notes/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This is the list of changes to MUSE between each release.
55

66
To update to the latest version, run ``pip install --upgrade muse-os``
77

8+
* :ref:`/release-notes/v1.5.0.md`
89
* :ref:`/release-notes/v1.4.3.md`
910
* :ref:`/release-notes/v1.4.2.md`
1011
* :ref:`/release-notes/v1.4.1.md`

docs/release-notes/v1.5.0.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Release notes for MUSE v1.5.0 (July 31, 2025)
2+
3+
These are the main changes in MUSE v1.5.0.
4+
5+
## Improvements to the input data format
6+
7+
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

Comments
 (0)