PyPSA / PyPSA/pypsa-eur

Error in build_elecrity_demand.py due to wrong data in load_synthetic_raw.csv

Open
#1,685 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
615
Forks
459
Avg merge
4d 14h
Merged PRs (30d)
6

Description

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

  • I have confirmed this bug exists on the current master branch of PyPSA-Eur.

Issue Description

Within the load_synthetic_raw.csv file, which is created during the rule retrieve.smk the old country code from Kosovo (KV) is still used. This causes an issue, if the data is used (e. g. running pypsa for the years before 2005 or 2020 and later.

The easiest fix I found for now, is renaming the column with KV to XK in the rule retrieve.smk. (The proper fix would be to replace the table on zenodo with an updated version). In order to run the code, the script build_electricity_demand.py needs also to be updated.

replace line 286:
countries = list(set(countries) - set(["UA", "MD", "XK"]))
with this
countries = list(set(countries) - set(["UA", "MD",]))

also the comment above: "UA, MD, XK do not appear in synthetic load data" is not correct anymore, since KV is already in the file and just needs to be renamed to XK.

Also the doctoring needs to be updates as well (still uses KV instead of XK)

Reproducible Example
run the current version with all countries, for years, which are not in the range 2005-2019
Expected Behavior

expected behavior, would be no error within build_electricity.smk that basically says, that large data parts are missing, due to the reasons I explained above.

Installed Versions

This issue is not related to the environment and should arise on all systems

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

Inspect retrieve.smk and build_electricity_demand.py, then check the related documentation that still uses KV. Run the current version with all countries for years outside 2005–2019; done means the build completes without reporting missing large data parts and the outdated Kosovo code references are corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.