Skip to content

Commit

Permalink
split bioenergy into biogas and solid biomass
Browse files Browse the repository at this point in the history
  • Loading branch information
fneum committed Sep 10, 2024
1 parent f49532d commit 1e6839f
Show file tree
Hide file tree
Showing 8 changed files with 21,091 additions and 21,072 deletions.
2 changes: 1 addition & 1 deletion doc/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The dataset combines the data of all the data sources listed in
`Data-Sources <#Data-Sources>`__ and provides the following information:

- **Power plant name** - claim of each database
- **Fueltype** - {Bioenergy, Geothermal, Hard Coal, Hydro, Lignite,
- **Fueltype** - {Solid Biomass, Biogas, Geothermal, Hard Coal, Hydro, Lignite,
Nuclear, Natural Gas, Oil, Solar, Wind, Other}
- **Technology** - {CCGT, OCGT, Steam Turbine, Combustion Engine,
Run-Of-River, Pumped Storage, Reservoir}
Expand Down
2 changes: 2 additions & 0 deletions doc/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Release Notes
Upcoming Version
----------------

* BREAKING: Split "Bioenergy" into "Biogas" and "Solid Biomass".

Version 0.5.18 (30.08.2024)
---------------------------

Expand Down
53 changes: 35 additions & 18 deletions powerplantmatching/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ def CARMA(raw=False, update=False, config=None):
"GEO": "Geothermal",
"WSTH": "Waste",
"SUN": "Solar",
"BLIQ": "Bioenergy",
"BGAS": "Bioenergy",
"BSOL": "Bioenergy",
"BLIQ": "Solid Biomass",
"BGAS": "Biogas",
"BSOL": "Solid Biomass",
"OTH": "Other",
}
)
Expand Down Expand Up @@ -950,11 +950,11 @@ def WEPP(raw=False, config=None):
)
# Replace fueltypes
d = {
"AGAS": "Bioenergy", # Syngas from gasified agricultural waste
"AGAS": "Solid Biomass", # Syngas from gasified agricultural waste
"BFG": "Other", # blast furnance gas -> "Hochofengas"
"BGAS": "Bioenergy",
"BIOMASS": "Bioenergy",
"BL": "Bioenergy",
"BGAS": "Biogas",
"BIOMASS": "Solid Biomass",
"BL": "Solid Biomass",
"CGAS": "Hard Coal",
"COAL": "Hard Coal",
"COG": "Other", # coke oven gas -> deutsch: "Hochofengas"
Expand All @@ -971,13 +971,13 @@ def WEPP(raw=False, config=None):
"JET": "Oil", # Jet fuels
"KERO": "Oil", # Kerosene
"LGAS": "Other", # landfill gas -> deutsch: "Deponiegas"
"LIGNIN": "Bioenergy",
"LIGNIN": "Solid Biomass",
"LIQ": "Other", # (black) liqour -> deutsch: "Schwarzlauge",
# die bei Papierherstellung anfaellt
"LNG": "Natural Gas", # Liquified natural gas
"LPG": "Natural Gas", # Liquified petroleum gas (u. butane/propane)
"MBM": "Bioenergy", # Meat and bonemeal
"MEDWST": "Bioenergy", # Medical waste
"MBM": "Solid Biomass", # Meat and bonemeal
"MEDWST": "Solid Biomass", # Medical waste
"MGAS": "Other", # mine gas -> deutsch: "Grubengas"
"NAP": "Oil", # naphta
"OGAS": "Oil", # Gasified crude oil/refinery bottoms/bitumen
Expand All @@ -994,8 +994,8 @@ def WEPP(raw=False, config=None):
"UNK": "Other",
"UR": "Nuclear",
"WAT": "Hydro",
"WOOD": "Bioenergy",
"WOODGAS": "Bioenergy",
"WOOD": "Solid Biomass",
"WOODGAS": "Solid Biomass",
"WSTGAS": "Other", # waste gas -> deutsch: "Industrieabgas"
"WSTWSL": "Waste", # Wastewater sludge
"WSTH": "Waste",
Expand Down Expand Up @@ -1212,7 +1212,7 @@ def UBA(
uba.loc[uba.Fueltype.str.contains("HEL"), "Fueltype"] = "Oil"
uba.Fueltype = uba.Fueltype.replace(
{
"Biomasse": "Bioenergy",
"Biomasse": "Solid Biomass",
"Gichtgas": "Other",
"HS": "Oil",
"Konvertergas": "Other",
Expand Down Expand Up @@ -1372,7 +1372,7 @@ def BNETZA(
".*(?i)energietr.*ger.*\n.*": "Other",
"Kern.*": "Nuclear",
"Mineral.l.*": "Oil",
"Biom.*": "Bioenergy",
"Biom.*": "Solid Biomass",
".*(?i)(e|r|n)gas": "Other",
"Geoth.*": "Geothermal",
"Abfall": "Waste",
Expand Down Expand Up @@ -1548,10 +1548,10 @@ def IRENASTAT(raw=False, update=False, config=None):
"Renewable hydropower": "Hydro",
"Mixed Hydro Plants": "Hydro",
"Pumped storage": "Hydro",
"Solid biofuels": "Bioenergy",
"Solid biofuels": "Solid Biomass",
"Renewable municipal waste": "Waste",
"Liquid biofuels": "Bioenergy",
"Biogas": "Bioenergy",
"Liquid biofuels": "Solid Biomass",
"Biogas": "Biogas",
"Geothermal energy": "Geothermal",
"Marine energy": "Marine",
"Coal and peat": "Hard Coal",
Expand Down Expand Up @@ -1606,13 +1606,30 @@ def GBPT(raw=False, update=False, config=None):
RENAME_COLUMNS = {
"Project name": "Name",
"Capacity (MW)": "Capacity",
"Fuel 1": "Fueltype",
"Operating status": "Status",
"Latitude": "lat",
"Longitude": "lon",
"Unit start year": "DateIn",
"Retired year": "DateOut",
"GEM phase ID": "projectID",
}
fueltype_dict = {
'bioenergy - agricultural waste (solids)': 'Solid Biomass',
'bioenergy - refuse (municipal and industrial wastes)': 'Solid Biomass',
'bioenergy - refuse (syngas)': 'Solid Biomass',
'bioenergy - agricultural waste (biogas)': 'Biogas',
'bioenergy - wood & other biomass (solids)': 'Solid Biomass',
'bioenergy - ethanol': 'Solid Biomass',
'bioenergy - paper mill wastes': 'Solid Biomass',
'bioenergy - biodiesel': 'Solid Biomass',
'bioenergy - unknown': 'Solid Biomass',
'bioenergy - wastewater and sewage sludge (solids or biogas)': 'Solid Biomass',
'bioenergy - refuse (landfill gas)': 'Biogas',
'bioenergy - agricultural waste (unknown)': 'Solid Biomass',
'bioenergy - agricultural waste (syngas)': 'Solid Biomass',
'bioenergy - wood & other biomass (biocoal)': 'Solid Biomass',
}

status_list = config["GBPT"].get("status", ["operating"]) # noqa: F841

Expand All @@ -1630,7 +1647,7 @@ def GBPT(raw=False, update=False, config=None):
)
.query("Status in @status_list")
.pipe(lambda x: x[df.columns.intersection(config.get("target_columns"))])
.assign(Fueltype="Bioenergy")
.pipe(lambda x: x.replace({"Fueltype": fueltype_dict}))
.assign(Technology="Steam Turbine")
.assign(Set="PP")
.pipe(config_filter, config)
Expand Down
3 changes: 2 additions & 1 deletion powerplantmatching/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def fueltype_to_abbrev():
Return the fueltype-specific abbreviation.
"""
data = {
"Bioenergy": "BIO",
"Solid Biomass": "BIO",
"Biogas": "BIG",
"Geothermal": "GEO",
"Hard Coal": "COA",
"Hydro": "HYD",
Expand Down
9 changes: 5 additions & 4 deletions powerplantmatching/heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def wm(x):
)

if target_fueltypes is None:
target_fueltypes = ["Wind", "Solar", "Bioenergy"]
target_fueltypes = ["Wind", "Solar", "Biogas", "Solid Biomass"]
df = df[df.Fueltype.isin(target_fueltypes)]
df = fill_missing_commissioning_years(df)
df["Technology"] = df.Technology.fillna("-")
Expand Down Expand Up @@ -432,7 +432,8 @@ def reduceVintages(addition, mat, life, y_pres):
columns=range(y_start - life + 1, y_end + life),
index=range(y_start - life + 1, y_end),
).astype(float)
if dfs.Fueltype.iloc[0] in ["Solar", "Wind", "Bioenergy", "Geothermal"]:
fuels = ["Solar", "Wind", "Biogas", "Solid Biomass", "Geothermal"]
if dfs.Fueltype.iloc[0] in fuels:
mat = setInitial_Triangle(mat, dfs, life)
else:
mat = setInitial_Flat(mat, dfs, life)
Expand Down Expand Up @@ -540,12 +541,12 @@ def gross_to_net_factors(reference="opsd", aggfunc="median", return_entire_data=
df.replace(
dict(
energy_source_level_2={
"Biomass and biogas": "Bioenergy",
"Biomass and biogas": "Biogas",
"Fossil fuels": "Other",
"Mixed fossil fuels": "Other",
"Natural gas": "Natural Gas",
"Non-renewable waste": "Waste",
"Other bioenergy and renewable waste": "Bioenergy",
"Other bioenergy and renewable waste": "Solid Biomass",
"Other or unspecified energy sources": "Other",
"Other fossil fuels": "Other",
"Other fuels": "Other",
Expand Down
9 changes: 6 additions & 3 deletions powerplantmatching/package_data/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ target_fueltypes:
# given by the list. An empty string results in a regex expression containing only the key.
# Parsed of representatives at the top may be overwritten by representatives further below.
Other: ".*"
Bioenergy: [biological, biogas, bioenergy, agricultural, wood, biomass]
Solid Biomass: [biological, bioenergy, agricultural, wood, biomass]
Biogas: [biogas]
Nuclear: [nuclear]
Natural Gas:
[
Expand Down Expand Up @@ -397,7 +398,8 @@ clean_name:
# Heuristic Config #
# ---------------------------------------------------------------------------- #
fuel_to_lifetime:
Bioenergy: 20
Solid Biomass: 20
Biogas: 20
Geothermal: 15
Hard Coal: 45
Hydro: 100
Expand Down Expand Up @@ -427,7 +429,8 @@ fuel_to_color:
Offshore: cornflowerblue
Onshore: darkblue
Wind: steelblue
Bioenergy: forestgreen
Biogas: green
Solid Biomass: forestgreen
Natural Gas: red
CCGT: red
Coal: black
Expand Down
5 changes: 3 additions & 2 deletions powerplantmatching/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,15 @@ def set_uncommon_fueltypes_to_other(df, fillna_other=True, config=None, **kwargs
Whether to replace NaN values in 'Fueltype' with 'Other'
fueltypes : list
list of replaced fueltypes, defaults to
['Bioenergy', 'Geothermal', 'Mixed fuel types', 'Electro-mechanical',
['Solid Biomass', 'Biogas', 'Geothermal', 'Mixed fuel types', 'Electro-mechanical',
'Hydrogen Storage']
"""
config = get_config() if config is None else config
df = get_obj_if_Acc(df)

default = [
"Bioenergy",
"Solid Biomass",
"Biogas",
"Geothermal",
"Mixed fuel types",
"Electro-mechanical",
Expand Down
Loading

0 comments on commit 1e6839f

Please sign in to comment.