-
Notifications
You must be signed in to change notification settings - Fork 35
1. Get API key and setup local environment
The API is hosted at https://developer.nrel.gov/api/reopt
. In order to access the API you need to get an API key. Once you have a key you can access the API with something like:
https://developer.nrel.gov/api/reopt/stable/help?API_KEY=DEMO_KEY
You will have to replace DEMO_KEY
with your own key (the DEMO_KEY
only allows a few hits per day).
There are two ways to setup an environment from which to call the API using the scripts in this wiki:
- 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.
- 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 - If there is an error in the build process (likely pulling the base image), try first running
docker pull jupyter/datascience-notebook
and then dodocker compose up
- 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