Skip to content

Commit

Permalink
Merge pull request #225 from AgnesBelt/documentation
Browse files Browse the repository at this point in the history
Added instructions to install graphviz, if needed.
  • Loading branch information
trevorb1 authored May 18, 2024
2 parents 8e103ed + 15e5dae commit efe0e17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
17 changes: 11 additions & 6 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ save the solution as ``simplicity.sol``. Use otoole to create a folder of CSV re

$ otoole results cplex csv simplicity.sol results csv data config.yaml

.. _model-visualization:

Model Visualization
-------------------

Expand All @@ -217,18 +219,21 @@ Run the following command, where the RES will be saved as the file ``res.png``::

.. WARNING::
If you encounter a ``graphviz`` dependency error, install it on your system
from the graphviz_ website (if on Windows) or via the command::
following instructions on the Graphviz_ website. If on Windows,
download the install package `from Graphviz <https://graphviz.org/download/>`_.
If on Mac or Linux, or running conda, use one of the following commands::

sudo apt install graphviz # if on Ubuntu
brew install graphviz # if on Mac
brew install graphviz # if on Mac
sudo apt install graphviz # if on Ubuntu
conda install graphviz # if using conda

To check that ``graphviz`` installed correctly, run ``dot -V`` to check the
version::

~$ dot -V
$ dot -V
dot - graphviz version 2.43.0 (0)

1. View the RES
2. View the RES
~~~~~~~~~~~~~~~
Open the newly created file, ``res.png`` and the following image should be
displayed
Expand Down Expand Up @@ -503,4 +508,4 @@ will also flag it as an isolated fuel. This means the fuel is unconnected from t
.. _CPLEX: https://www.ibm.com/products/ilog-cplex-optimization-studio/cplex-optimizer
.. _Anaconda: https://www.anaconda.com/
.. _Gurobi: https://www.gurobi.com/
.. _graphviz: https://www.graphviz.org/download/
.. _Graphviz: https://www.graphviz.org/download/
9 changes: 7 additions & 2 deletions docs/functionality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,14 @@ visualising the reference energy system through the ``vis res`` command is suppo

.. NOTE::
The ``resfile`` command should include a file ending used for images,
including ``bmp``, ``jpg``, ``pdf``, ``png`` etc. The graphviz_ library
including ``bmp``, ``jpg``, ``pdf``, ``png`` etc. The Graphviz_ library
used to layout the reference energy system will interpret the file ending.

.. WARNING::
If you encounter a Graphviz_ dependencey error, please follow Graphviz_
installation instructions described in the
:ref:`visualization examples <model-visualization>`.

Validation
----------
The validation module in ``otoole`` checks technology and fuel names against a
Expand Down Expand Up @@ -217,4 +222,4 @@ the rest of the model::
.. _CPLEX: https://www.ibm.com/products/ilog-cplex-optimization-studio/cplex-optimizer
.. _Gurobi: https://www.gurobi.com/
.. _`OSeMOSYS Repository`: https://github.com/OSeMOSYS/OSeMOSYS_GNU_MathProg/tree/master/scripts
.. _graphviz: https://graphviz.org/
.. _Graphviz: https://graphviz.org/

0 comments on commit efe0e17

Please sign in to comment.