PyPSA / PyPSA/powerplantmatching

Duplicating generation assets

Open
#273 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs triage
Dominant language
Python
Stars
227
Forks
74
Avg merge
6d 17h
Merged PRs (30d)
4

Description

Version Checks (indicate both or one)
  • I have confirmed this bug exists on the lastest release of powerplantmatching.

  • I have confirmed this bug exists on the current master branch of powerplantmatching.

Issue Description

When using powerplantmatching for some non-European countries in PyPSA-Earth, we have observed some duplication, as mentioned in this old issue. For example, such duplicating appears when running build_powerplants rule of PyPSA-Earth 0.8.0 for Colombia. After some investigation, the reason is the way GEM datasets are being treated if taken in combination with other databases.

Reproducible Example
## basic code

import powerplantmatching as pm
import yaml
config = {
    'matching_sources': 
        [
            'GEO', 'GPD',
            'GBPT', 'GGPT', 'GCPT', 'GGTPT', 'GNPT', 'GSPT', 'GWPT', 'GHPT'
        ],
    'fully_included_sources': 
        [
            'GEO', 'GPD',
            'GBPT', 'GGPT', 'GCPT', 'GGTPT', 'GNPT', 'GSPT', 'GWPT', 'GHPT'
        ], 
    'target_countries': 'Colombia',
    'main_query': '(DateOut >= 2022 or DateOut != DateOut)'
}

ppl = (
    pm.powerplants(
        from_url=False,
        update=True,
        config_update=config,
    )
    .query('Fueltype not in ["Solar", "Wind"]')
)

ppl.to_csv("test_ppm_co_minimal.csv")
Expected Behavior

A modelling-ready dataset of power plants for Colombia. Instead, a dataset is produced with multiple duplicates which require manual cleaning-up ("test_ppm_co_minimal.csv"). E.g. Termosierra power plant present in two versions: as Termosierra Ccgt Colombia (426 MWe) and Termosierra (460 MWe).

This duplication can be removed if GEM-sources datasets ('GEO', 'GPD') are excluded or if only they are kept (the output files are test_ppm_co_minimal_without_gem.csv and test_ppm_co_minimal_gem_only.csv, respectively).

Installed Versions
powerplantmatching 0.7.1 pyhd8ed1ab_0 conda-forge

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided powerplantmatching example for Colombia and compare the three output cases: all sources, no GEM sources, and GEM-only sources. Trace how GEO and GPD are combined with the other matching sources during pm.powerplants, especially for the build_powerplants workflow. Done means the resulting modelling-ready dataset no longer contains duplicate plants such as the two Termosierra records.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.