Skip to content

add Biomethanation - #257

Merged
fneum merged 15 commits into
PyPSA:masterfrom
BertoGBG:biomethanation_PR
Nov 17, 2026
Merged

fneum merged 15 commits into
PyPSA:masterfrom
BertoGBG:biomethanation_PR

Conversation

@BertoGBG

Copy link
Copy Markdown
Contributor

Closes # (if applicable).

Changes proposed in this Pull Request

added biomethantion technology (biological methantion of CO2 with electrolytic H2). The technology is part of the DEA catalogue and it was added via compile_cost_assumptions.py

Checklist

  • [ Y] Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • [ Y] Data source for new technologies is clearly stated.
  • Newly introduced dependencies are added to environment.yaml (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • [Y ] I consent to the release of this PR's code under the GPLv3 license.

Comment thread scripts/compile_cost_assumptions.py Outdated
df.index = df.index.str.replace(" Total Input", "_H2")

# Rename indices and update units
replacements = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the renames more consistent with the most commonly used names?

hydrogen-input
co2-input
electricity-input etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the names to the most commonly used names (eg. methane-output insect of Methane Output).
for the final DF and csv file.
Note that the index names set in biomethanation_dea (like "El-Input", "H-Output") (the lines you mentioned) are only used as search keys by str.contains() in the filtering at lines 2155–2204 and 2312–2340. They never appear in the final CSV.

@martavp

martavp commented Apr 9, 2026

Copy link
Copy Markdown
Member

I was trying to double-check the saved values for biochar but the output files are removed in this PR, please, add them again @BertoGBG

@BertoGBG

BertoGBG commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

the cost files were added

@BertoGBG

Copy link
Copy Markdown
Contributor Author

@martavp this PR is only for the biomethanation technolgies, not biochar. They are alternative technolgies to Sabatier reaction and can substitute the biogas upgrading converting the CO2 in the biogas (and H2) to Methane through a biological process. It does not require CO2 removal and the CO2 in the biogas is retained in the system without the need for CO2 netowrk.

@euronion

euronion commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Hej @BertoGBG , is this PR ready for another round of review?

BertoGBG and others added 3 commits June 15, 2026 17:17
EW input rows belonged to EW_PR (PyPSA#256) and leaked in via shared branch
history. Removed from inputs/manual_input.csv and regenerated outputs so
PyPSA#257 contains biomethanation only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@BertoGBG

BertoGBG commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor Author

I updated the PR and rebased to the latest verision of the master branch.

Heads up: CI on master itself is currently failing — test_get_sheet_location, test_get_data_from_dea, and test_add_carbon_capture fail on a clean master checkout (KeyError: ('cement capture', 'Variable O&M')).
My rebased PR inherits this, so their CI failure isn't from my changes — the snakemake build and output
regeneration pass. They should go green once master's tests are fixed.

@BertoGBG
BertoGBG requested a review from fneum June 15, 2026 15:45
euronion and others added 5 commits June 18, 2026 10:51
- normalise DEA sheet 106 flows to methane produced, as DEA costs (note A),
  methanation and biogas plus hydrogen; drops the cost rescaling to MWh_H2
- units MWh_H2, MWh_el, MWh_th, MWh_biogas and t_CO2 per MWh_CH4, EUR/kW_CH4
- rename CO2-input to carbondioxide-input; drop redundant methane-output
- note that biogas CH4 passes the reactor and CO2 is contained in biogas
- simplify biomethanation_dea, order_data branch and pure CO2 variant
- add biomethanation to DEA sheet tests; restore old DEA renewable fuels PDF
- move release note to doc/release_notes.md
@fneum
fneum merged commit 2db6e05 into PyPSA:master Nov 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants