Skip to content

Conversation

@lmezilis
Copy link

@lmezilis lmezilis commented Nov 5, 2025

Closes # (if applicable).

Changes proposed in this Pull Request

Checklist

  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are documented in doc/configtables/*.csv.
  • Sources of newly added data are documented in doc/data_sources.rst.
  • A release note doc/release_notes.rst is added.

@lmezilis lmezilis closed this Nov 5, 2025
@lmezilis lmezilis reopened this Nov 5, 2025
@lmezilis
Copy link
Author

lmezilis commented Nov 5, 2025

Changes in configuration options are added in config/config.electricity.yaml.

@fneum
Copy link
Member

fneum commented Nov 5, 2025

Great, could you try and resolve the merge conflicts so that we can have a look? Generally, keeping the diff as small as possible will help us review.

@lmezilis
Copy link
Author

lmezilis commented Nov 7, 2025

Can you let me know if the conflicts are resolved? Apologies for delays, but I am a bit new to github and its procedures.

@lkstrp
Copy link
Member

lkstrp commented Nov 7, 2025

@lmezilis They are, but you need to resolve the pre-commit checks now. See the failed check above or run it locally as described in the docs: https://pypsa-eur.readthedocs.io/en/latest/contributing.html

lmezilis and others added 9 commits November 10, 2025 11:20
* doc: Automatically update DAGs in documentation

* doc: Update release notes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* I find working with the CI always tricky

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* some adjustments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: lkstrp <lkstrp@pm.me>
@lmezilis
Copy link
Author

@lkstrp Ok, I think I completed that, please let me know if I missed anything.

Copy link
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

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

Looks mostly good. Some more cleaning up and dataset handling required before this can be merged. This will also require an update of pixi.toml as this feature depends on a new atlite version:

PyPSA/atlite#475

Copy link
Member

Choose a reason for hiding this comment

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

Keep the changes to an absolute minimum here and try not to change any unrelated config settings. Only changes from config.default.yaml should be listed here.

add_missing_carriers(n, c.df.carrier)

carrier_i = n.carriers.index
print(n.carriers.index)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
print(n.carriers.index)

no print statements please

"onshore wind",
"offshore wind",
"offshore wind (AC)",
"offshore wind",
Copy link
Member

Choose a reason for hiding this comment

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

Why this change? Now offshore wind is duplicated.

"solar rooftop",
"solar",
"building retrofitting",
"floating solarbuilding retrofitting",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"floating solarbuilding retrofitting",
"floating solar",
"building retrofitting",

/scripts/old
/scripts/create_scenarios.py
/config/create_scenarios.py
# /envs/win-64.lock.yaml
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# /envs/win-64.lock.yaml

lhs = p_nom.groupby(ext_carrier_i).sum()
rhs = mincaps[lhs.indexes["carrier"]].rename_axis("carrier")
n.model.add_constraints(lhs >= rhs, name="bau_mincaps")
logger.info("BAU is done.")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
logger.info("BAU is done.")

not necessary

Comment on lines +510 to +540
for connection in ["farshore", "nearshore", "shallow"]:
tech = "wave-" + connection
landfall_length = landfall_lengths.get(tech, 0.0)
if tech not in n.generators.carrier.values:
continue
profile = snakemake.input["profile_wave-" + connection]
with xr.open_dataset(profile) as ds:
# if-statement for compatibility with old profiles
if "year" in ds.indexes:
ds = ds.sel(year=ds.year.min(), drop=True)

distance = ds["average_distance"].to_pandas()
submarine_cost = costs.at[tech + "-connection-submarine", "fixed"]
underground_cost = costs.at[tech + "-connection-underground", "fixed"]
connection_cost = line_length_factor * (
distance * submarine_cost + landfall_length * underground_cost
)

capital_cost = (
costs.at["wave", "fixed"]
+ costs.at[tech + "-station", "fixed"]
+ connection_cost
)

logger.info(
f"Added connection cost of {connection_cost.min():0.0f}-{connection_cost.max():0.0f} Eur/MW/a to {tech}"
)

n.generators.loc[n.generators.carrier == tech, "capital_cost"] = (
capital_cost.rename(index=lambda node: node + " " + tech)
)
Copy link
Member

Choose a reason for hiding this comment

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

This code is very similar to the offshore wind handling above. Are you sure this can not be integrated rather than duplicated here? DRY coding principles.

Copy link
Member

Choose a reason for hiding this comment

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

For plotting, also colours and nice names must be added to plotting.default.yaml.

+ costs.at[car + "-station", "capital_cost"]
+ connection_cost
)
if car == "offsolar":
Copy link
Member

Choose a reason for hiding this comment

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

The code in this block contains a lot of duplications per carrier. Are you sure this can not be integrated rather than duplicated here? DRY coding principles.

wdpa_marine="data/WDPA_WDOECM_marine.gpkg",
gebco=lambda w: (
"data/bundle/gebco/GEBCO_2014_2D.nc"
"data/bundle/gebco/GEBCO_2023_2D.nc"
Copy link
Member

Choose a reason for hiding this comment

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

This change in dataset still needs to be properly handled. See https://pypsa-eur.readthedocs.io/en/latest/data_sources.html.

In particulary, data/versions.py must be adapted:

"gebco","primary","2014","['latest', 'supported']","https://www.bodc.ac.uk/data/open_download/gebco/GEBCO_30SEC/zip/","The dataset will be cut for the required regions after download"
"gebco","archive","2014","['latest', 'supported']","https://zenodo.org/records/16810417/files/GEBCO_2014_2D.nc","Earlier part of databundle"

Additionally, the retrieval rule (download) must be updated correspondingly.

Could you also explain why the update is necessary? Is it because the resolution was upgraded from 30 to 15 arc-seconds? Does it have any impact?

Could we also directly update to the 2025 version while we are at it? https://www.gebco.net/data-products-gridded-bathymetry-data/gebco2025-grid

Note, that the archive version should have a spatially reduced scope to Europe. It is unnecessary to download the full 4 GB of global bathymetry for a European model. For the required total bounds, see the current GEBCO archived data.

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