Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split bioenergy into biogas and solid biomass #201

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ out simulations.
- visualize the data
- export your powerplant data to a [PyPSA](https://github.com/PyPSA/PyPSA)-based model

## Map

![powerplants.png](doc/powerplants.png)

## Installation

Using pip
Expand Down
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: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ combining dataset, which includes all the important information. The
package allows to easily update the combined data as soon as new input
datasets are released.

.. figure:: https://user-images.githubusercontent.com/19226431/46086361-36a13080-c1a8-11e8-82ed-9f04167273e5.png
.. figure:: powerplants.png
:alt: Map of power plants in Europe

Map of power plants in Europe
Expand Down
Binary file added doc/powerplants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
34 changes: 19 additions & 15 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 All @@ -414,28 +416,30 @@ fuel_to_lifetime:
# Plotting Config #
# ---------------------------------------------------------------------------- #
fuel_to_color:
OCGT: darkorange
Hydro: seagreen
Pumped hydro: limegreen
Run-of-river: navy
Ror: navy
Lignite: saddlebrown
Nuclear: yellow
OCGT: lightcoral
Hydro: lightseagreen
Pumped hydro: aquamarine
Run-of-river: lightseagreen
Ror: lightseagreen
Lignite: sienna
Nuclear: mediumorchid
Solar: gold
Windoff: cornflowerblue
Windon: darkblue
Offshore: cornflowerblue
Onshore: darkblue
Wind: steelblue
Bioenergy: forestgreen
Natural Gas: red
CCGT: red
Biogas: yellowgreen
Bioenergy: green
Solid Biomass: forestgreen
Natural Gas: orangered
CCGT: orangered
Coal: black
Hard Coal: dimgray
Oil: black
Other: silver
Waste: grey
Geothermal: orange
Other: lightgrey
Waste: olive
Geothermal: darkgoldenrod
Battery: purple
Hydrogen Storage: teal
Electro-mechanical: teal
Expand Down
4 changes: 2 additions & 2 deletions powerplantmatching/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def fueltype_stats(df):

def powerplant_map(
df,
scale=1e1,
scale=2e1,
alpha=0.6,
european_bounds=True,
fillcontinents=False,
Expand Down Expand Up @@ -117,7 +117,7 @@ def powerplant_map(
ax.set_xlabel("")
ax.set_ylabel("")
if european_bounds:
ax.set_xlim(-13, 34)
ax.set_xlim(-13, 40)
ax.set_ylim(35, 72)
draw_basemap(ax=ax, resolution=resolution, fillcontinents=fillcontinents)
ax.set_facecolor("w")
Expand Down
4 changes: 1 addition & 3 deletions powerplantmatching/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,13 @@ 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',
['Mixed fuel types', 'Electro-mechanical',
'Hydrogen Storage']
"""
config = get_config() if config is None else config
df = get_obj_if_Acc(df)

default = [
"Bioenergy",
"Geothermal",
"Mixed fuel types",
"Electro-mechanical",
"Hydrogen Storage",
Expand Down
Loading