-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from trevorb1/otoole-v1.0-update
- Loading branch information
Showing
7 changed files
with
1,953 additions
and
3,367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
results/*.csv | ||
simplicity.txt |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
# OSeMOSYS Example Model: Simplicity | ||
|
||
[![DOI](https://zenodo.org/badge/214192147.svg)](https://zenodo.org/badge/latestdoi/214192147) | ||
[![goodtables.io](https://goodtables.io/badge/github/OSeMOSYS/simplicity.svg)](https://goodtables.io/github/OSeMOSYS/simplicity) | ||
|
||
This is an example OSeMOSYS model published as a Frictionless Data [Tabular Data Package](https://frictionlessdata.io/specs/tabular-data-package/). | ||
This is an example OSeMOSYS model used to demonstrate the functionality of the Python | ||
package [otoole](https://github.com/OSeMOSYS/otoole). You can use **otoole** to generate | ||
a GNU MathProg data file from the dataset with the following commands. Full | ||
**otoole** documentation (including installation and examples) can be found on | ||
its [ReadTheDocs site](https://otoole.readthedocs.io/en/latest/). | ||
|
||
The Data Package was constructed with the help of the Python **otoole** package available on [PyPI](https://pypi.org/project/otoole/) and [Github](https://github.com/OSeMOSYS/otoole). | ||
|
||
Simplicity `v0.2` requires `v0.5.4` or later of **otoole**. | ||
You can use **otoole** to generate a GNU MathProg data file from the dataset with the following commands and then run OSeMOSYS. | ||
**NOTE**: To be able to solve the model in this example, you will need to install | ||
the free and open-source solver [GLPK](https://www.gnu.org/software/glpk/) | ||
|
||
```bash | ||
# Install the OSeMOSYS toolkit | ||
pip install otoole>=0.5.4 | ||
# Download the dataset and build a GNU MathProg datafile | ||
# On Linux or OSX use wget | ||
pip install otoole>=1.0.0 | ||
|
||
# Download the dataset. On Linux or OSX use wget, otherwise download and unzip | ||
wget https://zenodo.org/record/3707794/files/OSeMOSYS/simplicity-v0.2.1.zip | ||
unzip simplicity-v0.2.1.zip -d simplicity | ||
# Otherwise download manually and unzip, and then... | ||
otoole convert datapackage datafile simplicity/OSeMOSYS-simplicity-11a3a26/datapackage.json ./simplicity.txt | ||
|
||
# Create the GNUMathProg data file with otoole | ||
otoole convert csv datafile simplicity/data ./simplicity.txt simplicity/config.yaml | ||
|
||
# Solve the model | ||
glpsol -m OSeMOSYS.txt -d simplicity.txt | ||
``` |
Oops, something went wrong.