Download and Installation
Temoa is implemented in Pyomo, which is in turn written in Python. Consequently, Temoa will run on Linux, Mac, Windows, or any operating system that Pyomo supports.There are several open source software elements required to run Temoa. The easiest way to install these elements is to create a conda environment in which to run the model. Creating a customized environment ensures that the latest version of Temoa is compatible with the required software elements. To begin, you need to have conda installed either via miniconda or anaconda. Next, download the environment.yml file from our Github repo, and place it in a new directory named ‘temoa-py3.’ Create this new directory in a location where you wish to store the environment. Navigate to this directory and execute the following from the command line:
$ conda env create
Then activate the environment as follows:
$ conda activate temoa-py3
More information on virtual environments can be found here.
This new conda environment contains several elements, including Python 3, a compatible version of Pyomo, matplotlib, numpy, scipy, and two free solvers (GLPK and CBC). Windows users: the CBC solver is not available for Windows through conda. Thus, in order to install the environment properly, the last line of the ‘environment.yml’ file specifying ‘coincbc’ should be deleted. A few notes for on the choice of solvers. Different solvers have widely varying solution times. If you plan to run Temoa with large datasets and/or conduct uncertainty analysis, you may want to consider installing commercial linear solvers such as CPLEX or Gurobi. Both offer free academic licenses. Another option is to run CPLEX on the NEOS server (see below for details).
Now that you have functioning environment, you need to obtain the source code for Temoa. There are a couple of options for obtaining and running Temoa from GitHub. If you want to simply run the model, you can download Temoa from GitHub as a zip file. Navigate to our GitHub repository, and click the green ‘clone or download’ button near the top-right corner. Select ‘Download ZIP,’ and you can download the entire Temoa ‘energysystem’ (our main branch) to your local machine. The second option creates a local copy of the model source code in our GitHub repository. This is a two step process: first install git and then ‘clone’ the repository. Under Linux, git can be installed through the default package manager. Git for Windows and Mac can be downloaded here. To clone the Temoa repository, navigate to the directory where you want the model to reside and type the following from the prompt:
$ git clone https://github.com/TemoaProject/temoa/
Note that cloning the repository will supply the latest version of the code, and allow you to archive changes to the code and data in your own local git repository.
A few basic input data files are included in the ‘temoa/data_files’ folder. Additional Temoa-compatible datasets are available in this separate GitHub repo.
The installation procedures above are meant to be generic and should work across different platforms. Nonetheless, system-specific ambiguities and unexpected conditions inevitably arise. Please use the Temoa forum to ask for help.
The most basic way to run Temoa is with an input data (DAT) file:
$ python temoa_model/ /path/to/dat/file
This option will simply run the model and output the results to the shell. To make sure the model is functioning correctly, try running with the ‘Utopia’ dataset:
$ python temoa_model/ data_files/utopia-15.dat
To run the model with more features, use a configuration (‘config’) file. An example config file called ‘config_sample’ resides within the ‘temoa_model’ folder. Running the model with a config file allows the user to (1) use a sqlite database for storing input and output data, (2) create a formatted Excel output file, (2) specify the solver to use, (3) return the log file produced during model execution, (4) return the lp file utilized by the solver, and (5) to execute modeling-to-generate alternatives (MGA). Note that if you do not have access to a commercial solver, it may be faster run cplex on the NEOS server. To do so, simply specify cplex as the solver and uncomment the ‘–neos’ flag.
$ python temoa_model/ --config=temoa_model/config_sample
For more information, see the Temoa user manual.