PowerGenome

A tool to quickly and easily create inputs for power systems models.
https://github.com/powergenome/powergenome

Category: Energy Systems
Sub Category: Energy Data Accessibility and Integration

Keywords

capacity-expansion-planning power-systems python

Keywords from Contributors

climate

Last synced: about 24 hours ago
JSON representation

Repository metadata

A tool to quickly and easily create inputs for power systems models

README.md

PowerGenome

The project has reached a stable, usable state and is being actively developed.
code style black
DOI
pytest
codecov
pre-commit.ci status
Documentation

Full documentation is available at https://powergenome.github.io/PowerGenome.

Power system optimization models can be used to explore the cost and emission implications of different regulations in future energy systems. One of the most difficult parts of running these models is assembling all the data. A typical model will define several regions, each of which need data such as:

  • All existing generating units (perhaps grouped into a few discrete clusters within each region)
  • Transmission constraints between regions
  • Hourly load profiles (including new loads from vehicle and building electrification)
  • Hourly generation profiles for wind & solar
  • Cost estimates for new generating units

Because computational complexity and run times increase as the number of regions and generating unit clusters increases, a user might want only want to disaggregate regions and generating units close to the primary region of interest. For example, a study focused on clean electricity regulations in New Mexico might combine several states in the Pacific Northwest into a single region while also splitting Arizona combined cycle units into multiple clusters.

The goal of PowerGenome is to let a user make all of these choices in a settings file and then run a single script that generates input files for the power system model. PowerGenome currently generates input files for GenX.

Data

PowerGenome uses data from a number of different sources, including EIA, NREL, and EPA. The data inputs consist of two main components:

  1. Tabular data - Database tables or files (CSV/Parquet) containing:

    • Existing generating units
    • New resource costs
    • Resource operational parameters
    • Transmission constraints between regions
    • Cost of increasing transmission capacity between regions
    • Hourly demand profiles by region
    • Fuel prices
    • Distributed generation capacity and profiles
    • Value of currency over time
  2. Renewable Resource Data - Generation profiles and resource group mapping files:

    • generation_profiles - Hourly wind/solar generation profiles, either by site or mapped to resource sites
    • metadata - Files that assign interconnection costs to specific renewable sites, and maps each to a model region

Installation

The easiest way to install PowerGenome is from PyPI:

pip install powergenome

If you are installing a packaged version of PowerGenome you won't be able to easily use a .env file. Instead, add the environment parameters (PUDL_DB, PG_DB, etc) to a YAML file in the same folder as the rest of your settings. It doesn't really matter which file these parameters are included in but creating a new file such as env.yml will help keep them separate from other settings parameters that might be shared with other PowerGenome users.

After installation, skip to step 4 below to download the required data files.

uv is a fast Python package and project manager. If you're developing PowerGenome or need the latest features:

  1. Clone this repository to your local machine and navigate to the top level (PowerGenome) folder.

  2. Install uv if you haven't already. You can use the standalone installer (recommended):

On macOS and Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Or install via pip:

pip install uv
  1. Create a virtual environment and install PowerGenome in editable mode:
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .

For development work with additional tools (black, pytest, etc.):

uv pip install -e ".[dev]"

Option 3: Install from GitHub with conda

If you prefer conda for environment management:

  1. Clone this repository to your local machine and navigate to the top level (PowerGenome) folder.

  2. Use the provided environment.yml file to create a conda environment named powergenome. If you don't already use conda it is easiest to download and install Miniconda.

conda env create -f environment.yml
  1. Activate the powergenome environment.
conda activate powergenome
  1. pip-install an editable version of this project
pip install -e .

Running code

Suggested folder structure

It is best practice to set up project folders outside of the cloned repository so that git doesn't track any new/changed files within the upper-level PowerGenome folder. Keeping project folders separate from the cloned PowerGenome folder will also make it easier to pull changes as they are released.

Example systems

A few example systems are included at https://github.com/PowerGenome/PowerGenome-examples. Each system has settings files in a folder (settings) and a folder with extra user inputs (extra_inputs). The different example systems are not meant to be accurate for real-world analysis, so please do not blindly use the external data files included with them in your own studies!

Settings

Settings are controlled in a set of YAML files within a folder or combined into a single file. An example folder of settings files (settings) and folder with extra user inputs (extra_inputs) are included in each of the example systems. Scenario options across different planning years are defined in the file test_scenario_inputs.csv. Documentation on extra inputs is included in the folder of each example system.

Example notebooks

A series of example notebooks are included in PowerGenome/notebooks describe how to access different functions within PowerGenome to create resource clusters, variable generation profiles, fuel costs, hourly demand, and transmission constraints. They include a description of how the data are compiled and the settings parameters that are required for each type of data.

Command line interface

The outputs are all formatted for GenX we hope to make the data formatting code more module to allow users to easily switch between outputs for different power system models.

Functions from each module can be imported and used in an interactive environment (e.g. JupyterLab). Examples of how to load data in this way are included in PowerGenome/notebooks. To run from the command line, navigate to a project folder that contains a settings file and extra inputs (e.g. myproject/powergenome), activate the powergenome conda environment, and use the command run_powergenome with flags for the settings file name and where the results should be saved. Since the powergenome package is installed in the powergenome conda environment, you can run the command line function from anywhere on your computer (not just within the cloned PowerGenome folder).

run_powergenome --settings_file settings --results_folder test_system

The command line arguments --settings_file and --results_folder can be shortened to -sf and -rf respectively. For all options, run:

run_powergenome --help

A folder with extra user inputs is required when using the run_powergenome command. The name of this folder is defined in the settings YAML file with the input_folder parameter. Look at the files in each example system for test cases to follow.

If you have previously installed PowerGenome and the run_powergenome command doesn't work, try reinstalling it using pip install -e . as described above. If you downloaded the custom PUDL database before May of 2020, some errors may be resolved by downloading a new version.

Licensing

PowerGenome is released under the MIT License. Most data inputs are from US government sources (EIA, EPA, FERC, etc), which should not be subject to copyright in the US. Hourly FERC demand data has been cleaned using techniques developed by Tyler Ruggles and David Farnham, and allocated to IPM regions using methods developed by Catalyst Cooperative. Hourly generation profiles for wind and solar resources were created by Vibrant Clean Energy and provided without usage restrictions. All PowerGenome data outputs are released under the CC-BY-4.0 license.

Contributing

Contributions are welcome! There is significant work to do on this project and additional perspective on user needs will help make it better. If you see something that needs to be improved, open an issue. If you have questions or need assistance, join PowerGenome on groups.io and post a message there.

Pull requests are always welcome. To start modifying/adding code, make a fork of this repository, create a new branch, and submit a pull request.

All code added to the project should be formatted with black. After making a fork and cloning it to your own computer, run pre-commit install to install the git hook scripts that will run every time you make a commit. These hooks will automatically run black (in case you forgot), fix trailing whitespace, check yaml formatting, etc.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 1,971
Total Committers: 20
Avg Commits per committer: 98.55
Development Distribution Score (DDS): 0.463

Commits in past year: 275
Committers in past year: 4
Avg Commits per committer in past year: 68.75
Development Distribution Score (DDS) in past year: 0.193

Name Email Commits
Greg Schivley g****y@g****m 1058
Greg Schivley g****g@c****o 662
ezwelty e****y@g****m 101
pre-commit-ci[bot] 6****] 35
copilot-swe-agent[bot] 1****t 27
Qingyu Xu q****x@p****u 14
Greg Schivley g****g@G****e 11
bradenpecora b****1@g****m 11
lbonaldo b****2@g****m 11
Neha Patankar n****k@n****u 10
gmantegna 3****a 5
Neha Patankar p****r@p****u 5
Matthias Fripp m****p@e****g 4
ritibhandarkar r****r@g****m 4
aneeshamanocha a****a@g****m 3
annafjacobson a****n@g****m 3
Becca 3****e 2
Bill Shobe s****e@v****u 2
sambuddhac s****i@g****m 2
dependabot[bot] 4****] 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 192
Total pull requests: 316
Average time to close issues: 5 months
Average time to close pull requests: about 2 months
Total issue authors: 26
Total pull request authors: 21
Average comments per issue: 0.91
Average comments per pull request: 0.84
Merged pull request: 235
Bot issues: 0
Bot pull requests: 54

Past year issues: 8
Past year pull requests: 35
Past year average time to close issues: 6 days
Past year average time to close pull requests: 25 days
Past year issue authors: 2
Past year pull request authors: 5
Past year average comments per issue: 0.13
Past year average comments per pull request: 1.26
Past year merged pull request: 22
Past year bot issues: 0
Past year bot pull requests: 3

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/powergenome/powergenome

Top Issue Authors

  • gschivley (136)
  • rebeccamccabe (7)
  • nspatank (7)
  • fikrikscg (6)
  • sambuddhac (5)
  • NLaws (3)
  • xuqingyu (3)
  • mfripp (2)
  • Msypa7 (2)
  • cfe316 (2)
  • AlannLiu (2)
  • joshdr83 (2)
  • d3n1AL (2)
  • gmantegna (1)
  • zaneselvans (1)

Top Pull Request Authors

  • gschivley (197)
  • github-actions[bot] (34)
  • dependabot[bot] (12)
  • bradenpecora (9)
  • pre-commit-ci[bot] (8)
  • rebeccamccabe (8)
  • mfripp (7)
  • nspatank (6)
  • Copilot (6)
  • lbonaldo (5)
  • xuqingyu (5)
  • NLaws (4)
  • annafjacobson (3)
  • wshobe (2)
  • Rangrang-Zheng (2)

Top Issue Labels

  • enhancement (26)
  • bug (25)
  • help wanted (4)
  • good first issue (3)
  • GenX (2)

Top Pull Request Labels

  • dependencies (12)
  • enhancement (3)
  • python (2)
  • bug (1)

Package metadata

proxy.golang.org: github.com/PowerGenome/PowerGenome

proxy.golang.org: github.com/powergenome/powergenome

pypi.org: powergenome

Create power system inputs for capacity expansion models

  • Homepage:
  • Documentation: https://powergenome.readthedocs.io/
  • Licenses: MIT
  • Latest release: 0.8.0 (published 2 months ago)
  • Last Synced: 2026-11-07T08:49:00.515Z (2 days ago)
  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 67 Last month
  • Rankings:
    • Dependent packages count: 7.282%
    • Average: 24.322%
    • Dependent repos count: 41.361%
  • Maintainers (1)

Dependencies

requirements.txt pypi
  • beautifulsoup4 *
  • catalystcoop.pudl *
  • cpi *
  • flatten-dict *
  • geopandas *
  • isort *
  • pandas >=0.24
  • pre-commit *
  • pyarrow *
  • pytest *
  • python-dotenv *
  • pyyaml *
  • requests *
  • ruamel.yaml *
  • sklearn *
  • xlrd *
.github/workflows/pytest.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v3 composite
  • mamba-org/provision-with-micromamba main composite
pyproject.toml pypi
  • beautifulsoup4 >= 4.8.13
  • catalystcoop.pudl >=0.6.0, <=2022.11.30
  • flatten-dict *
  • frozendict *
  • geopandas >=0.11
  • openpyxl >=3.0
  • python-dotenv *
  • pyyaml *
  • ruamel.yaml *
  • statsmodels >=0.12.2
environment.yml conda
  • beautifulsoup4
  • black
  • conda-forge:
  • duckdb
  • isort
  • jupyterlab
  • numpy
  • openpyxl >=3.0
  • pip
  • pre-commit
  • pytest
  • python 3.10
  • pyyaml
  • statsmodels >=0.13
.github/workflows/deploy-docs.yml actions
  • actions/checkout v6 composite
  • actions/setup-python v6 composite

Score: 13.084536891863872