Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codespell_ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
datas
raison
fom
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A clear and concise description of what the bug is, including error messages.

## To Reproduce

Steps to reproduce the behavior. Attache any input file that might be required.
Steps to reproduce the behavior. Attach any input file that might be required.

## Expected behavior

Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ repos:
hooks:
- id: pretty-format-toml
args: [--autofix, --indent, "4", --no-sort]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: [--ignore-words, .codespell_ignore.txt]
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
- Tutorials in the documentation are run as tests ([#177](https://github.com/SGIModel/MUSE_OS/pull/177))
- Clean notebooks before running them as tests in the documentaition ([#173](https://github.com/EnergySystemsModellingLab/MUSE_OS/pull/173))
- Add technology-granularity to sectoral outputs ([#214](https://github.com/SGIModel/MUSE_OS/pull/214))
- Add descripion to bisection method ([#149](https://github.com/SGIModel/MUSE_OS/pull/149))
- Add descripion to demo cases ([#139](https://github.com/SGIModel/MUSE_OS/pull/139))
- Add description to bisection method ([#149](https://github.com/SGIModel/MUSE_OS/pull/149))
- Add description to demo cases ([#139](https://github.com/SGIModel/MUSE_OS/pull/139))
- Run link-checker only once a week ([#148](https://github.com/SGIModel/MUSE_OS/pull/148))
- Update documentation for installing MUSE ([#138](https://github.com/SGIModel/MUSE_OS/pull/138))
- Updating pyproject.toml with valid python versions ([#121](https://github.com/SGIModel/MUSE_OS/pull/121))
Expand Down
10 changes: 6 additions & 4 deletions docs/advanced-guide/extending-muse.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@
"source": [
"### Cached quantities\n",
"\n",
"The result of intermediate calculations are often useful for post-morten analysis or\n",
"The result of intermediate calculations are often useful for post-mortem analysis or\n",
"simply to have a more detailed picture of the evolution of the calculation over time.\n",
"The process of adding a new quantity to cache and output has three steps:\n",
"\n",
"1. Register the function with `register_cached_quantity` that will deal with the \n",
" consolidation of the cached quantity prior to outputing in such a way it can be\n",
" consolidation of the cached quantity prior to outputting in such a way it can be\n",
" accepted by one of the sinks. It can also be used to modify what is saved, filtering\n",
" by technologies or agents, for example.\n",
"2. Cache the quantity in each iteration of the market using\n",
Expand Down Expand Up @@ -318,7 +318,7 @@
"source": [
"The above function is nearly identical to `muse.outputs.cache.capacity` but filtering\n",
"the output such that only information related to retorfit agents is included in the\n",
"output. As a function with the same name intended to chache the `capacity` already\n",
"output. As a function with the same name intended to cache the `capacity` already\n",
"exists, we have to set `overwrite = True` in the decorator, so that it replaces the\n",
"built in version.\n",
"\n",
Expand Down Expand Up @@ -581,7 +581,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"As previously demonstrated, we can easily add new functionality to MUSE. However, running a jupyter notebook is not always the best approach. It is also possible to store functions in an arbitrary pthon file, such as the following:"
"As previously demonstrated, we can easily add new functionality to MUSE. However,\n",
"running a jupyter notebook is not always the best approach. It is also possible to store\n",
"functions in an arbitrary Python file, such as the following:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/application-flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ An overall picture of this process can be seen in the following chart, but there
{node [shape=""]; start; end;}
exclude [label="Exclude\ncommodities\nfrom market"];
single_year [label="Single year\niteration", fillcolor="lightgrey", style="rounded,filled"]
maxiter [label="Maxium iter?", shape=diamond, style=""]
maxiter [label="Maximum iter?", shape=diamond, style=""]
converged [label="Converged?", shape=diamond, style=""]
prices [label="Update with\nconverged prices"]
{node [label="Update with not\nconverged prices"]; prices1; prices2;}
Expand Down
2 changes: 1 addition & 1 deletion docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Here we provide a glossary for some of the frequently used terms in this documen
This is where an agent does not know everything needed to make a perfect decision.

Levelised cost of electricity
The levelised cost of electricty is a measure of the average net present cost of electricity generation for a generating plant over its lifetime.
The levelised cost of electricity is a measure of the average net present cost of electricity generation for a generating plant over its lifetime.

Limited foresight
Limited foresight is the condition that an agent is unable to predict the entire future perfectly. The agent is only able to predict the future either imperfectly, or a limited time ahead.
Expand Down
2 changes: 1 addition & 1 deletion docs/inputs/agents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Type
technologies they can consider (by :ref:`SearchRule <SearchRule>`). "New" agents
invest on the rest of the demand, and can often consider more general sets of
technologies. If only "New" agents are included, they will also invest to make up for
decomissioned assets, but the end mix might be different than using a specialised
decommissioned assets, but the end mix might be different than using a specialised
"Retrofit" agent for that.

AgentShare
Expand Down
4 changes: 2 additions & 2 deletions docs/inputs/commodities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ CommodityType
which are either extracted, transformed from one to another, or used in the energy system.

The "service" type includes commodities such as space heating or hot water which correspond to selected
poples' needs whose fulflment requires energy uses.
poples' needs whose fulfillment requires energy uses.

The "material" type represent non-energy inputs for energy technologies, such as limestone or oxygen.
The "environmental" type refers to non-energy commodities whichare used to quantify an inpact on the environment,
The "environmental" type refers to non-energy commodities whichare used to quantify an impact on the environment,
such as greenhouse gases or CO2. They can be subjected to different types of environmental fees or taxes.

CommodityName
Expand Down
4 changes: 2 additions & 2 deletions docs/inputs/technodata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ Agent_0, ..., Agent_N
resBoilerElectric, region1, 2010, ..., 1
resBoilerElectric, region1, 2030, ..., 1

In a two-agent simulation, a new column neeeds to be added for each retrofit agent belonging to the new-retrofit agent pair.
In a two-agent simulation, a new column needs to be added for each retrofit agent belonging to the new-retrofit agent pair.
The column heading refers each retrofit agent "AgentShare" as defined in the agents' definition (see :ref:`inputs-agents`).
Assuming a split of the initial capacity into 30 \% and 70 \% for each retrofit agent, the model table would be setup as follows.
The values of the "AgetnShare" needs to reflect the demand split represented by the "Quantity" attribute (see :ref:`inputs-agents`),
to make sure that the initial demand is fullfilled with the initial stock.
to make sure that the initial demand is fulfilled with the initial stock.

.. csv-table:: Techno-data: AgentShare - 2 agents
:header: ProcessName, RegionName, Time, ..., Agent_2, Agent_4
Expand Down
2 changes: 1 addition & 1 deletion docs/inputs/technodata_timeslices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
======================
Techno-data Timeslices
======================
The techno-data timeslices is an optinal file which contains information on technologies, their region, timeslices, utilization factors and minimum service factor. The objective of this file is to link the utilization factor and minimum service factor to timeslices. For instance, if you were to model solar photovoltaics, you would probably want to specify that they can not produce any electricty at night, or if you're modelling a nuclear power plant, that they must generate a minimum amount of electricity. The techno-data timeslice file enables you to do that. Note, that if this file is not present, the utilization facto will be used from the technodata file.
The techno-data timeslices is an optional file which contains information on technologies, their region, timeslices, utilization factors and minimum service factor. The objective of this file is to link the utilization factor and minimum service factor to timeslices. For instance, if you were to model solar photovoltaics, you would probably want to specify that they can not produce any electricity at night, or if you're modelling a nuclear power plant, that they must generate a minimum amount of electricity. The techno-data timeslice file enables you to do that. Note, that if this file is not present, the utilization facto will be used from the technodata file.


.. csv-table:: Techno-data
Expand Down
26 changes: 13 additions & 13 deletions docs/inputs/toml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ described in this :ref:`previous section <toml-primer>`. Here, however, we focus
attributes that are specific to MUSE.

The TOML file can be read using :py:func:`~readers.toml.read_settings`. The resulting
data is used to construt the market clearing algorithm directly in the :py:meth:`MCA's
data is used to construct the market clearing algorithm directly in the :py:meth:`MCA's
factory function <mca.MCA.factory>`.

------------
Expand Down Expand Up @@ -90,7 +90,7 @@ a whole.
Carbon market
-------------

This section containts the settings related to the modelling of the carbon market. If omitted, it defaults to not
This section contains the settings related to the modelling of the carbon market. If omitted, it defaults to not
including the carbon market in the simulation.

Example
Expand All @@ -109,7 +109,7 @@ Example
*method*
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`.

The market-clearing algortihm iterates over the sectors until the market reaches an equilibrium in the foresight period (the period next to the one analysed).
The market-clearing algorithm iterates over the sectors until the market reaches an equilibrium in the foresight period (the period next to the one analysed).
This is represented by a stable variation of a commodity demand (or price) between iterations below a defined tolerance.
The market-clearing algorithm samples a user-defined set of carbon prices.

Expand Down Expand Up @@ -145,7 +145,7 @@ Example
`price_too_high_threshold`, a user-defined threshold based on heuristics on the values of the carbon price, reflecting typical historical trends.

*fitter*
`fitter` specifies the regression model fit. The regresion approximates the model emissions. Predefined options are `linear` and `exponential`. Further options can be defined using the `@register_carbon_budget_fitter` hook in `muse.carbon_budget`.
`fitter` specifies the regression model fit. The regression approximates the model emissions. Predefined options are `linear` and `exponential`. Further options can be defined using the `@register_carbon_budget_fitter` hook in `muse.carbon_budget`.

------------------
Global input files
Expand Down Expand Up @@ -259,7 +259,7 @@ See section on `Timeslices_`.
*outputs_cache*
This option behaves exactly like `outputs` for sectors and accepts the same options but
controls the output of cached quantities instead. This option is NOT available for
sectors themselves (i.e using `[[sector.comercial.outputs_cache]]` will have no effect). See
sectors themselves (i.e using `[[sector.commercial.outputs_cache]]` will have no effect). See
:py:mod:`muse.outputs.cache` for more details.

A single row looks like this:
Expand Down Expand Up @@ -292,13 +292,13 @@ the user, since it will not affect the model itself.

Sectors are defined in :py:class:`~muse.sectors.Sector`.

A sector accepts these atributes:
A sector accepts these attributes:

.. _sector-type:

*type*
Defines the kind of sector this is. *Standard* sectors are those with type
"default". This value corresponds to the name with which a sector class is registerd
"default". This value corresponds to the name with which a sector class is registered
with MUSE, via :py:meth:`~muse.sectors.register_sector`. [INSERT OTHER OPTIONS HERE]

.. _sector-priority:
Expand Down Expand Up @@ -441,7 +441,7 @@ Sectors contain a number of subsections:
See :ref:`inputs-iocomms`.

Once the finest timeslice and its aggregates are given, it is possible for each sector
to define the timeslice simply by refering to the slices it will use at each level.
to define the timeslice simply by referring to the slices it will use at each level.

.. _sector-timeslices:

Expand Down Expand Up @@ -508,7 +508,7 @@ to define the timeslice simply by refering to the slices it will use at each lev
writing, three are available:

- an "adhoc" solver: Simple in-house solver that ranks the technologies
according to cost and sevice the demand incrementally.
according to cost and service the demand incrementally.

- "scipy" solver: Formulates investment as a true LP problem and solves it using
the `scipy solver`_.
Expand All @@ -518,7 +518,7 @@ to define the timeslice simply by refering to the slices it will use at each lev
Users can install it with ``pip install cvxopt`` or ``conda install cvxopt``.

*demand_share*
A method used to split the MCA demand into seperate parts to be serviced by
A method used to split the MCA demand into separate parts to be serviced by
specific agents. A basic distinction is between *new* and *retrofit* agents: the
former asked to respond to an increase of commodity demand investing in new
assets; the latter asked to invest in new asset to balance the decommissined
Expand Down Expand Up @@ -626,7 +626,7 @@ simulation.

Preset sectors are defined in :py:class:`~muse.sectors.PresetSector`.

The three components, production, consumption, and prices, can be set independantly and
The three components, production, consumption, and prices, can be set independently and
not all three need to be set. Production and consumption default to zero, and prices
default to leaving things unchanged.

Expand Down Expand Up @@ -661,7 +661,7 @@ The following attributes are accepted:

*consumption_path*
CSV output files, one per year. This attribute can include wild cards, i.e. '*',
which can match anything. For instance: `consumption_path = "{cwd}/Consumtion*.csv"` will match any csv file starting with "Consumption" in the
which can match anything. For instance: `consumption_path = "{cwd}/Consumption*.csv"` will match any csv file starting with "Consumption" in the
current working directory. The file names must include the year for which it defines
the consumption, e.g. `Consumption2015.csv`.

Expand Down Expand Up @@ -787,4 +787,4 @@ itself can use the following attributes.
Path to a technodata CSV file. See. :ref:`inputs-technodata`.

*output_path*
Path to a diretory where the sector will write output files.
Path to a directory where the sector will write output files.
4 changes: 2 additions & 2 deletions docs/inputs/toml_primer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ dictionary).
[[some_table_of_data]]
a_key = "another value"

.. Since MUSE requires a number of data files, paths to file can be formated quite
.. Since MUSE requires a number of data files, paths to file can be formatted quite
.. flexibly. A `path` any key-value where the value ends with `.csv` or `.toml`,
.. as well any key which ends in `_path`, `_file`, or `_dir`, e.g. `data_path` or
.. `sector_dir`. Paths can be formatted with shorthands for specific directories.
.. Shorth-hands are specified by curly-brackets:

As MUSE requires a number of data file, paths to files can be formated in a flexible manner. Paths can be formatted with shorthands for specific directories and are defined with curly-brackets. For example:
As MUSE requires a number of data file, paths to files can be formatted in a flexible manner. Paths can be formatted with shorthands for specific directories and are defined with curly-brackets. For example:


.. code-block:: TOML
Expand Down
6 changes: 5 additions & 1 deletion docs/installation/pipx-based.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ MUSE needs Python to run but, for now, it only works with versions 3.8 and 3.9,

.. note::

Windows users should disable the alias for Python that comes by default with Windows and that will try to install Python from the Microsoft Store everytime we write ``python`` in the terminal. To do so, press the ``Windows key`` and start typing ``alias``, when it shows up, click in ``Manage app execution aliases``. In the window that opens, disable all the entries related to Python, like in the image.
Windows users should disable the alias for Python that comes by default with Windows
and that will try to install Python from the Microsoft Store every time we write
``python`` in the terminal. To do so, press the ``Windows key`` and start typing
``alias``, when it shows up, click in ``Manage app execution aliases``. In the
window that opens, disable all the entries related to Python, like in the image.

.. image:: ../figures/disable_python_alias.png
:width: 400
Expand Down
4 changes: 2 additions & 2 deletions docs/muse-components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Technologies, and their parameters are defined in the Technodata.csv file. For a
Sectors
-------

Sectors typically group areas of economic activity together, such as the residential sector, which might include all energy conusming activies of households. Possible examples of sectors are:
Sectors typically group areas of economic activity together, such as the residential sector, which might include all energy conusming activities of households. Possible examples of sectors are:

- Gas sector

Expand All @@ -70,7 +70,7 @@ Each of the technologies, which consume a commodity, also output a different com
Agents
------

Agents represent the investment decision makers in an energy system, for example consumers or companies. They invest in technologies that meet service demands, like heating, or produce other needed energy commodities, like electricity. These agents can be heterogenous, meaning that their investment priorities have the ability to differ.
Agents represent the investment decision makers in an energy system, for example consumers or companies. They invest in technologies that meet service demands, like heating, or produce other needed energy commodities, like electricity. These agents can be heterogeneous, meaning that their investment priorities have the ability to differ.

As an example, a generation company could compare potential power generators based on their levelized cost of electricity, their net present value, by minimising the total capital cost, a mixture of these and/or any user-defined approach. This approach more closely matches the behaviour of real-life agents in the energy market, where companies, or people, have different priorities and constraints.

Expand Down
Loading