Skip to content

migrate co2 budgets feature from pypsa-at#2186

Draft
pworschischek-aggmag wants to merge 3 commits into
PyPSA:masterfrom
AGGM-AG:feat/national-co2-budget-constraints
Draft

migrate co2 budgets feature from pypsa-at#2186
pworschischek-aggmag wants to merge 3 commits into
PyPSA:masterfrom
AGGM-AG:feat/national-co2-budget-constraints

Conversation

@pworschischek-aggmag

Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request

Migrates the PyPSA-AT CO2 budget constraint to open a PR in PyPSA-Eur upstream.

Checklist

Required:

  • Changes are tested locally and behave as expected.
  • Code and workflow changes are documented.
  • A release note entry is added to doc/release_notes.rst.
  • Changes in configuration options are reflected in scripts/lib/validation.
  • New rules are documented in the appropriate doc/*.rst files.

Comment thread scripts/solve_network.py
"""
from scripts.prepare_sector_network import determine_emission_sectors

national_co2_budgets = snakemake.config["solving"]["constraints"][

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.

use rule param instead

Comment thread scripts/solve_network.py
links = n.links

for ct, yearly_percent in national_co2_budgets.items():
if investment_year in yearly_percent:

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.

  • logic flip?
  • missing interpolation logic?

Comment thread scripts/solve_network.py
Comment thread scripts/solve_network.py
]
aviation_total = aviation_domestic + aviation_international
domestic_aviation_factor = (
aviation_domestic / aviation_total if aviation_total else 0.0

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.

simplify to result=0.0; if aviation_total > 0: results=divide

Comment thread scripts/solve_network.py
n.model["Link-p"]
.loc[:, aviation_links.index]
# 'co2 atmosphere' is assumed to be at bus2 for aviation links
.mul(aviation_links["efficiency2"])

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.

untested assumption

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.

1 participant