REopt is a techno-economic decision support model from NREL which is used for optimizing energy systems for buildings, campuses, communities, and microgrids. REopt Lite offers any user the capability to perform their own techno-economic analysis, but customizable analysis solutions are also available by reaching out to NREL's REopt team. REopt Lite also offers an application programming interface (API). This is a guide to use REopt’s Application Programming Interface for running REopt analysis programmatically.
Detailed documentation of REopt Lite API is available in this repository's wiki.
This repository includes example scripts and notebooks for calling the API.
There are two ways to setup an environment from which to call the API:
- Use Docker to host a pre-configured Python environment
- Install a Python environment natively on your operating system
See the instructions below for each method.
- Obtain API_key from here
- Install Docker (https://www.docker.com/get-started)
- Open a command line terminal (e.g. command prompt, bash terminal) and type
cd path/to/cloned/repo
- Type
docker compose up --build
depending on the version of Docker - Click the provided URL (starting with
http://127.0.0.1
) to open Jupyter Lab in your browser - Click on the
work
folder in the left-hand project explorer and navigate to either of the notebooks (.ipynb files). - If running REopt locally, you will also need to spin up REopt Lite Docker containers (https://github.com/NREL/REopt_Lite_API)
- To shut down, cntrl+c in the terminal or shutdown using the Jupyter Lab controls
- To spin up again after you've already done
--build
in step 3. above, just typedocker compose up
and click the Jupyter URL
-
Install Python 3.6+ interpreter:
-
Install pip
Recommended: use a virtual environment with venv
-
Add the required python packages:
-
If using
venv
: activate the environment -
pip install -r requirements.txt
NOTE: The
requirements.txt
does not include dependecies for the jupyter notebooks -
-
(OPTIONAL) Install git: - https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- Clone, download, or fork the repository.
- See single_scenario_example.ipynb and multi_scenario_example.ipynb