Skip to main content

Country level electricity load analysis and projection

Project description

DemandForge

Country-level electricity load analysis and projection.

DemandForge is a Python-based workflow for analyzing and projecting country-level electricity load curves. It leverages weather data, electricity consumption data, and population statistics to model the relationship between temperature and electricity demand.

Features

  • Thermosensitivity Analysis: Calculates the sensitivity of electricity load to temperature changes for both winter and summer periods.
  • Data Fetching: Automatically fetches data from various sources, including:
    • ERA5 for weather data.
    • ENTSO-E for electricity load data.
    • GHSL for population data.
  • Workflow Management: Uses Snakemake to manage the data processing workflow, ensuring reproducibility and scalability.
  • Reporting: Generates detailed reports, including CSV files with results, plots of thermosensitivity by hour, and a comprehensive PDF report.

Workflow

The project is orchestrated by a Snakefile that defines the entire data processing pipeline. The workflow consists of two main parts:

  1. Fetching: The workflow/rules/fetch.smk rule fetches all the necessary data from the respective sources.
  2. Processing: The workflow/rules/process.smk rule processes the raw data, performs the thermosensitivity analysis, and generates the final reports.

The main steps in the workflow are:

  1. Fetch country borders.
  2. Fetch ENTSO-E load data for specified countries and years.
  3. Fetch ERA5 temperature data.
  4. Fetch GHSL population data.
  5. Calculate population-weighted temperature.
  6. Perform thermosensitivity analysis.
  7. Generate and upload reports.

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd demandforge
    
  2. Install dependencies: The project uses pip for dependency management. The required packages are listed in the pyproject.toml file.

    To install the core dependencies:

    pip install .
    

    To install dependencies for the workflow and notebooks:

    pip install .[workflow,notebooks]
    

Usage

  1. Configure the analysis: The analysis is configured through the config/config.yaml file. In this file, you can specify the countries, years, and other parameters for the analysis.

  2. Run the workflow: To run the entire workflow, use the following command:

    snakemake --cores <number-of-cores>
    

    This will execute the entire pipeline, from fetching the data to generating the final reports. The results will be saved in the directory specified in the config.yaml file.

Load projection usage

The project_load_curve function in demandforge/load_projection.py allows you to project future electricity load curves based on a reference year and scaling factors. This function can be used independently of the main Snakemake workflow. If the necessary combined load data for the reference year is not available locally, the function will automatically attempt to download it from a remote Google Cloud Storage bucket.

Example Usage

Here's how to use the project_load_curve function:

from demandforge.load_projection import project_load_curve

# Project load for Germany (DE) from a 2020 reference to 2030
# with a 2% yearly growth rate for baseload and EV load.
projected_df = project_load_curve(
    country="DE",
    reference_year=2020,
    target_year=2030,
    baseload_yearly_growth_rate=0.02,
    ev_yearly_growth_rate=0.02
)

print(projected_df.head())

In this example, we project the load curve for Germany from 2020 to 2030. We specify a 2% annual growth rate for both the baseload and electric vehicle (EV) load components. You can also specify target energy values directly instead of growth rates for each component (baseload, winter thermosensitive, summer thermosensitive, and EV load).

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

License

This project is licensed under the MIT License. See the LICENCE.md file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

demandforge-0.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file demandforge-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: demandforge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for demandforge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 164ccfa7f778e4e0bf521c0791767e11a2900431bd335d5203e01e7fb4d14562
MD5 a0ab9f8a0a50d93b24c9145f80e4d71b
BLAKE2b-256 1ce47eb494aad449bd99233baaaecf861350868fafa0670c4aa8183f99e6992f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page