Skip to content

fix(pypsa_io): include line shunt susceptance in per-grid to_pypsa export - #740

Open
nader-00 wants to merge 1 commit into
devfrom
654_pypsa_Line_bug
Open

fix(pypsa_io): include line shunt susceptance in per-grid to_pypsa export#740
nader-00 wants to merge 1 commit into
devfrom
654_pypsa_Line_bug

Conversation

@nader-00

@nader-00 nader-00 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Description

The mv/lv per-grid export path dropped the "b" column from lines_df while the full-grid path (mode=None) kept it, so PyPSA silently defaulted it to 0 instead of the real value on the per-grid path. Align both paths to select the same Line columns, and add a regression test that injects a distinguishing non-zero b to catch the divergence (issue #654).

No .rename(columns={"r_pu": "r", "x_pu": "x"}) belong to Line, only to Transformers, so it was kept untouched.

Fixes #654

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • New and adjusted code is formatted using the pre-commit hooks
  • New and adjusted code includes type hinting now
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The Read the Docs documentation is compiling correctly
  • If new packages are needed, I added them the setup.py, and if needed the rtd_requirements.txt, the eDisGo_env.yml and the eDisGo_env_dev.yml.
  • I have added new features to the corresponding whatsnew file

…port

The mv/lv per-grid export path dropped the "b" column from lines_df
while the full-grid path (mode=None) kept it, so PyPSA silently
defaulted it to 0 instead of the real value on the per-grid path.
Align both paths to select the same Line columns, and add a
regression test that injects a distinguishing non-zero b to catch
the divergence (issue #654).
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.

[BUG] to_pypsa handles the line b column inconsistently between modes

1 participant