-
Notifications
You must be signed in to change notification settings - Fork 363
Wave and floating solar updates #1883
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
base: master
Are you sure you want to change the base?
Conversation
|
Changes in configuration options are added in config/config.electricity.yaml. |
|
Great, could you try and resolve the merge conflicts so that we can have a look? Generally, keeping the |
Fix minor issues
Merge pull request PyPSA#2 from lmezilis/wave-updates
for more information, see https://pre-commit.ci
|
Can you let me know if the conflicts are resolved? Apologies for delays, but I am a bit new to github and its procedures. |
|
@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 |
…mrel into wave-updates
* 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>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
@lkstrp Ok, I think I completed that, please let me know if I missed anything. |
fneum
left a comment
There was a problem hiding this 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:
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| print(n.carriers.index) |
no print statements please
| "onshore wind", | ||
| "offshore wind", | ||
| "offshore wind (AC)", | ||
| "offshore wind", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "floating solarbuilding retrofitting", | |
| "floating solar", | |
| "building retrofitting", |
| /scripts/old | ||
| /scripts/create_scenarios.py | ||
| /config/create_scenarios.py | ||
| # /envs/win-64.lock.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # /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.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| logger.info("BAU is done.") |
not necessary
| 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) | ||
| ) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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": |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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:
Lines 60 to 61 in 73fb005
| "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.
Closes # (if applicable).
Changes proposed in this Pull Request
Checklist
envs/environment.yaml.config/config.default.yaml.doc/configtables/*.csv.doc/data_sources.rst.doc/release_notes.rstis added.