otoole : OSeMOSYS tools for energy work¶
A Python toolkit to support use of OSeMOSYS
Description¶
otoole is a Python package which provides a command-line interface for users of OSeMOSYS.
The aim of the package is to provide a community resource which centralises the commonly used pre- and post-processing steps around the use of OSeMOSYS.
otoole aims to support different ways of storing input data and results, including csv files, databases, datapackages and Excel workbooks, as well as different implementations of the OSeMOSYS model.
Dependencies¶
otoole requires a number of dependencies, including pygraphviz, which can be difficult to install on Windows.
The easiest way to install the dependencies is to use miniconda.
- Obtain the miniconda package:
- Add the conda-forge channel
conda config --add channels conda-forge
- Create a new Python environment
conda create -n myenv python=3.7 networkx datapackage pandas pulp graphviz xlrd
- Activate the new environment
conda activate myenv
- Use pip to install otoole
pip install otoole
Installation¶
Install otoole using pip:
pip install otoole
To upgrade otoole using pip:
pip install otoole --upgrade
Usage¶
For detailed instructions of the use of the tool, run the command line help function:
otoole --help
Contributing¶
New ideas and bugs are found on the repository Issue Tracker. Please do contribute by discussing and developing these ideas further, or by developing the codebase.
To contribute directly to the documentation of code development, you first need to install the package in develop mode:
git clone http://github.com/OSeMOSYS/otoole
cd otoole
git checkout <branch you wish to use>
python setup.py develop
Now, all changes made in the codebase will automatically be reflected in the installed Python version accessible on the command line or from importing otoole modules into other Python packages.
Getting Started¶
Install otoole
using pip:
pip install otoole
Check the version installed:
otoole -V
Download an OSeMOSYS datapackage and convert it to a modelfile:
otoole convert datapackage datafile https://zenodo.org/record/3479823/files/KTH-dESA/simplicity-v0.1a0.zip simplicity.txt
Visualise the Reference Energy System:
otoole viz res https://zenodo.org/record/3479823/files/KTH-dESA/simplicity-v0.1a0.zip res.png && open res.png
Alternatively, convert an OSeMOSYS datafile to a datapackage:
otoole convert datafile datapackage simplicity.txt simplicity
Validate the names of technologies and fuels against the standard naming convention and identify isolated fuels, emissions and technologies:
otoole validate datapackage https://zenodo.org/record/3479823/files/KTH-dESA/simplicity-v0.1a0.zip