Skip to content

Draft: Implementation of voltage levels 110kV-220kV using osm-raw#1740

Merged
fneum merged 26 commits intomasterfrom
distribution-grid
Aug 25, 2025
Merged

Draft: Implementation of voltage levels 110kV-220kV using osm-raw#1740
fneum merged 26 commits intomasterfrom
distribution-grid

Conversation

@bobbyxng
Copy link
Copy Markdown
Collaborator

@bobbyxng bobbyxng commented Jul 7, 2025

DRAFT / WIP

Changes proposed in this Pull Request

  • Minimal adjustments to allow for building grid using lower voltage levels, i.e., 110 kV-220kV

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.

@bobbyxng bobbyxng requested a review from fneum July 7, 2025 14:24
@bobbyxng bobbyxng self-assigned this Jul 7, 2025
@bobbyxng bobbyxng marked this pull request as draft July 7, 2025 14:25
@bobbyxng
Copy link
Copy Markdown
Collaborator Author

bobbyxng commented Jul 7, 2025

Plot

image

@bobbyxng
Copy link
Copy Markdown
Collaborator Author

bobbyxng commented Jul 7, 2025

@nesnoj
Copy link
Copy Markdown

nesnoj commented Jul 7, 2025

Wow, thanks a lot for coming up with this draft so quickly! @bobbyxng
I'll definitely have a look soonish and get back to you with my findings.

@fneum
Copy link
Copy Markdown
Member

fneum commented Jul 7, 2025

If you go down to 60kV you get coverage in France as well without adding many additional lines elsewhere.

@nesnoj
Copy link
Copy Markdown

nesnoj commented Jul 8, 2025

If you go down to 60kV you get coverage in France as well without adding many additional lines elsewhere.

Yes, 60 kV and further voltages should be included as well.

I'm focusing on DE and checked raw OSM (discarding lines holding multiple values): Unique voltages and filtering frequency and operator (e.g. DB Energie, to discard railway supply) results in
['0', '10000', '11000', '110000', '110kv', '15000', '150000', '155000', '20000', '220000', '225000', '230', '25000', '250000', '27000', '30000', '300000', '320000', '35000', '380000', '400', '400000', '50000', '60000', '600000', '63000', '65000', 'low', 'medium', 'minor', 'unknown'], so I included 60, 63 and 65 kV as well.
I'll report back further progress.

@bobbyxng shall I commit directly to this branch? Otherwise I'll work in a fork..

EDIT:
PS: We've done the distribution grid extraction for Germany before, so filtering and processing shouldn’t be too demanding. I'm less certain about the situation in the other countries.


Example Flensburg 60 kV:
image

@bobbyxng
Copy link
Copy Markdown
Collaborator Author

bobbyxng commented Jul 8, 2025

Please feel free to directly make commits to this branch @nesnoj
Good idea, I will try going down to 60 kV next @fneum

@nesnoj
Copy link
Copy Markdown

nesnoj commented Jul 8, 2025

Please feel free to directly make commits to this branch @nesnoj Good idea, I will try going down to 60 kV next @fneum

I've no rights so I committed in my fork: nesnoj@b0821e0
Unfortunately it's crashing atm in _add_transformers() here , will have to dig deeper..

@bobbyxng
Copy link
Copy Markdown
Collaborator Author

bobbyxng commented Jul 8, 2025

Please feel free to directly make commits to this branch @nesnoj Good idea, I will try going down to 60 kV next @fneum

I've no rights so I committed in my fork: nesnoj@b0821e0 Unfortunately it's crashing atm in _add_transformers() here , will have to dig deeper..

I have fixed the issue regarding transformers. This was because of non unique bus_ids that were created because of 66000 and 66600 kV levels being assigned the same identifier. Before this happens, voltage levels are floored to the next kV, so both 66000 kV and 66600 kV become 66000 kV

Copy link
Copy Markdown
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 to me.

The config/test/config.distribution-grid.yaml should be reduced to the diff to the config.default.yaml.

What is the purpose of config/test/config.distribution-grid.yaml? Should it be used for CI testing or just as an example? For case (1) it would need to be added to the CI routing (and should probably stop after clustering to save resources). For case (2), it should move to config/examples/config.distribution-grid.yaml.

Other question was about 90kV.

Comment thread config/test/config.distribution-grid.yaml Outdated
@bobbyxng bobbyxng marked this pull request as ready for review August 21, 2025 11:54
@bobbyxng
Copy link
Copy Markdown
Collaborator Author

  • Added release notes
  • Updated configs
  • Updated voltage levels [63., 66., 90., 110., 132., 150., 220., 300., 330., 380., 400., 500., 750.]
  • Tested with latest master merged into branch

@fneum From my side the PR is ready for merge with master. In the docs, I marked this as an experimental feature for now. The osm-prebuilt network will still be created from 220 kV upwards.

Copy link
Copy Markdown
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.

Code changes look good. Testing run myself now.

@fneum fneum merged commit f9cdaf2 into master Aug 25, 2025
6 of 7 checks passed
@fneum fneum deleted the distribution-grid branch August 25, 2025 15:16
measrainsey pushed a commit to open-energy-transition/pypsa-wal that referenced this pull request Sep 5, 2025
…PSA#1740)

* Bug fix for MultiLineStrings

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

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

* Reverted to absolute paths

* Reverted to absolute paths

* First running workflow for voltage levels 110kV <= v_nom < 220 kV

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

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

* Added 60 kV voltage level

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

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

* Updated example config.

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

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

* Updated configtables to include experimental distribution grid.

* Updated mock_snakemake defaults and added release_note.

* reduce diff

* move distribution-grid line types to config.default.yaml

* remove unnecessary quotation marks

* filter voltage level earlier and use spatial index for speed-up

* merge lines: resolve performance bottleneck

* improve performance for aggregate_to_substations

* remove wrong assumption unit test on present voltage levels

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabian Neumann <[email protected]>
toniseibold pushed a commit that referenced this pull request Dec 1, 2025
)

* Bug fix for MultiLineStrings

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

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

* Reverted to absolute paths

* Reverted to absolute paths

* First running workflow for voltage levels 110kV <= v_nom < 220 kV

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

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

* Added 60 kV voltage level

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

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

* Updated example config.

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

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

* Updated configtables to include experimental distribution grid.

* Updated mock_snakemake defaults and added release_note.

* reduce diff

* move distribution-grid line types to config.default.yaml

* remove unnecessary quotation marks

* filter voltage level earlier and use spatial index for speed-up

* merge lines: resolve performance bottleneck

* improve performance for aggregate_to_substations

* remove wrong assumption unit test on present voltage levels

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabian Neumann <[email protected]>
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.

3 participants