Skip to content

Commit

Permalink
Merge pull request #157 from koen-vg/irenastat2023
Browse files Browse the repository at this point in the history
Update IRENASTAT to 2023 data
  • Loading branch information
fneum authored Apr 25, 2024
2 parents 0611247 + 6197571 commit 0f315e3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ History of Changes
.. Upcoming Version
.. ----------------
*
* Update IRENASTAT to include data up to 2023.

Version 0.5.12 (07.04.2024)
---------------------------
Expand Down
26 changes: 17 additions & 9 deletions powerplantmatching/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,27 +1521,37 @@ def IRENASTAT(raw=False, update=False, config=None):

fn = get_raw_file("IRENA", update=update, config=config)

df = pd.read_csv(fn, comment="#")
df = pd.read_csv(fn, comment="#", quotechar='"')

if raw:
return df

RENAME_COLUMNS = {
"Installed electricity capacity by country/area (MW)": "Capacity",
"Electricity statistics": "Capacity",
"Country/area": "Country",
"Grid connection": "Grid",
}
df.rename(columns=RENAME_COLUMNS, inplace=True)

df.drop(columns="Data Type", inplace=True)

# Rename all entries "Congo (the)" to "Congo" under the column
# "Country"; the former confuses country_converter.
df["Country"] = df["Country"].replace("Congo (the)", "Congo")

# Consistent country names for dataset
df = convert_to_short_name(df)

df.dropna(subset="Capacity", inplace=True)

# Remove all rows where Technology is just a Total
df = df[
~df.Technology.str.contains("Total Renewable|Total Non-Renewable", na=False)
]

fueltype_dict = {
"On-grid Solar photovoltaic": "Solar",
"Off-grid Solar photovoltaic": "Solar",
"Concentrated solar power": "Solar",
"Solar photovoltaic": "Solar",
"Solar thermal energy": "Solar",
"Onshore wind energy": "Wind",
"Offshore wind energy": "Wind",
"Renewable hydropower": "Hydro",
Expand All @@ -1553,7 +1563,6 @@ def IRENASTAT(raw=False, update=False, config=None):
"Biogas": "Bioenergy",
"Geothermal energy": "Geothermal",
"Marine energy": "Marine",
"Fossil fuels": "Other",
"Coal and peat": "Hard Coal",
"Oil": "Oil",
"Natural gas": "Natural Gas",
Expand All @@ -1563,9 +1572,8 @@ def IRENASTAT(raw=False, update=False, config=None):
}

technology_dict = {
"On-grid Solar photovoltaic": "PV",
"Off-grid Solar photovoltaic": "PV",
"Concentrated solar power": "CSP",
"Solar photovoltaic": "PV",
"Solar thermal energy": "CSP",
"Onshore wind energy": "Onshore",
"Offshore wind energy": "Offshore",
"Pumped storage": "Pumped Storage",
Expand Down
4 changes: 2 additions & 2 deletions powerplantmatching/package_data/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ BEYONDCOAL:
IRENA:
net_capacity: true
aggregated_units: true
fn: IRENASTAT_capacities_2000-2020.csv
url: https://zenodo.org/record/6412255/files/IRENASTAT_capacities_2000-2020.csv
fn: IRENASTAT_capacities_2000-2023.csv
url: https://zenodo.org/records/10952917/files/IRENASTAT_capacities_2000-2023.csv
CARMA:
net_capacity: false
reliability_score: 1
Expand Down

0 comments on commit 0f315e3

Please sign in to comment.