/gridpath

A versatile simulation and optimization platform for power-system planning and operations.

Primary LanguagePythonApache License 2.0Apache-2.0

GridPath Test Suite Status Documentation Status Coverage Status Code style: black Lint Black DOI

Welcome to GridPath

Approaches

GridPath is a versatile power-system planning platform capable of a range of planning approaches including production-cost, capacity-expansion, asset-valuation, and reliability modeling.

Documentation

GridPath's documentation is hosted on Read the Docs.

Installation

Python

GridPath is developed and tested on Python 3.8. Get Python 3.8 here.

Python Packages

You should create a Python environment for your GridPath installation, e.g. via venv, a lightweight environment manager that is part of the standard Python distribution. You can install all needed Python packages, including the developer extras, by navigating to the GridPath root directory (which is where this README.md file is located) and running:

pip install -e .[all]

For most users, installing GridPath's base set of Python packages and those needed to use the graphical user interface would be sufficient. You can do so by running:

pip install -e .[ui]

NOTE: if you don't plan to edit the GridPath code, you can install without the -e option.

Solver

You will need a solver to use this platform. GridPath assumes you will be using Cbc (Coin-or branch and cut) by default, but you can specify a different solver (see the Usage section).

Usage

The gridpath_run and gridpath_run_e2e commands

If you install GridPath via the setup script following the instructions above, you can use the command gridpath_run to run a scenario from any directory -- as long as your GridPath Python environment is enabled -- as follows:

gridpath_run --scenario SCENARIO_NAME --scenario_location 
/PATH/TO/SCENARIO 

If you are using the database, you can use the command gridpath_run_e2e to run GridPath end-to-end, i.e. get inputs for the scenario from the database, solve the scenario problem, import the results into the database, and process them.

gridpath_run_e2e --scenario SCENARIO_NAME --scenario_location 
/PATH/TO/SCENARIO 

To see usage and other optional arguments, e.g. how to specify a solver, check the help menu, e.g.:

gridpath_run --help

NOTE: To activate your gridpath environment, use the following command ( assuming your environment is called "env", is created with venv, and is stored in the GridPath root folder):

source env/bin/activate

Help

In general, you can check usage of GridPath's scripts by calling the --help option, e.g.:

python get_scenario_inputs.py --help

Testing

To test the GridPath codebase, use the unittest module as follows from the root directory:

python -m unittest discover tests