Skip to content

Commit

Permalink
update GEM data to latest versions (Aug 2024) (#196)
Browse files Browse the repository at this point in the history
* update GEM data to latest versions (Aug 2024)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* annotate

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove duplicated key

* append codespell-ignore

* comparison with entsoe in 2022; handle retired plants

* rate GEM reliability scores higher

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* include 1-20 MW utility-scale solar

* update powerplants.csv

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fneum and pre-commit-ci[bot] authored Aug 23, 2024
1 parent a15a43f commit c3897f1
Show file tree
Hide file tree
Showing 7 changed files with 22,535 additions and 7,008 deletions.
3 changes: 2 additions & 1 deletion .codespell.ignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
GuD
ue
gud
hel
hel
BU
32 changes: 18 additions & 14 deletions analysis/compare-with-entsoe-stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pathlib
import time
import warnings

import country_converter as cc
Expand Down Expand Up @@ -27,18 +28,24 @@

client = EntsoePandasClient(api_key=config["entsoe_token"])

start = pd.Timestamp("20190101", tz="Europe/Berlin")
end = pd.Timestamp("20200101", tz="Europe/Berlin")
start = pd.Timestamp("20220101", tz="Europe/Berlin")
end = pd.Timestamp("20230101", tz="Europe/Berlin")

kwargs = dict(start=start, end=end, psr_type=None)


def parse(c):
try:
return client.query_installed_generation_capacity(c, **kwargs).iloc[0]
except Exception as e:
print(f"Country {c} failed with {e}")
return np.nan
rename = {"GB": "UK"}
for n in range(2):
try:
print(c, n)
return client.query_installed_generation_capacity(
rename.get(c, c), **kwargs
).iloc[0]
except Exception as e:
print(f"Country {c} failed with {e}")
time.sleep(3)
return np.nan


stats = pd.DataFrame({c: parse(c) for c in powerplants.Country.unique()})
Expand All @@ -48,22 +55,19 @@ def parse(c):
# Manual correction on the statistics

# https://de.wikipedia.org/wiki/Liste_von_Wasserkraftwerken_in_der_Schweiz?oldformat=true
stats.loc["CH", "Hydro"] = 18000
# https://www.bmk.gv.at/dam/jcr:f0bdbaa4-59f2-4bde-9af9-e139f9568769/Energie_in_OE_2020_ua.pdf
stats.loc["AT", "Hydro"] = 14600
# https://www.statista.com/statistics/496283/total-electricity-generation-capacity-uk/
stats.loc["GB", "Natural Gas"] = 37000 # (adding ~10GW)
stats.loc["GB", "Other"] = 1400 # (subtracting ~10GW)
stats.loc["DE", "Nuclear"] = 0
stats.loc["CH", "Hydro"] = 17038

# %%
query = "(DateOut > 2022 or DateOut != DateOut) and (DateIn < 2023 or DateIn != DateIn)"
powerplants = powerplants.query(query)
totals = powerplants.powerplant.lookup().fillna(0)

sources = [s if isinstance(s, str) else list(s)[0] for s in config["matching_sources"]]

input_dbs = {
s.title(): getattr(pm.data, s)()
.powerplant.convert_country_to_alpha2()
.query(query)
.powerplant.lookup()
.fillna(0)
for s in sources
Expand Down
5 changes: 3 additions & 2 deletions doc/release-notes.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Release Notes
==============

.. Upcoming Version
.. ----------------
Upcoming Version
----------------

* Update Global Energy Monitor data to latest versions as of 2024-08-23.

Version 0.5.16 (31.08.2024)
----------------
Expand Down
Loading

0 comments on commit c3897f1

Please sign in to comment.