Skip to content

Rebased and updated version of #1431. Applies nice_name to bus_carrier grouping in statistics.#1565

Merged
lkstrp merged 9 commits intoPyPSA:masterfrom
lukasschirren:patch-1
Feb 13, 2026
Merged

Rebased and updated version of #1431. Applies nice_name to bus_carrier grouping in statistics.#1565
lkstrp merged 9 commits intoPyPSA:masterfrom
lukasschirren:patch-1

Conversation

@lukasschirren
Copy link
Copy Markdown
Contributor

@lukasschirren lukasschirren commented Feb 11, 2026

Closes #1430
(update of closed PR #1431)

Changes proposed in this Pull Request

In pypsa/statistics/grouping.py, bus_carrier now:

  • obtains canonical bus.carrier identifiers with self.carrier(n, "Bus", nice_names=False),
  • builds the bus_carrier Series from those canonical values,
  • applies carriers.nice_name to the returned Series only when nice_names=True (display-only).

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in docs.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes docs/release-notes.md of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@lkstrp
Copy link
Copy Markdown
Member

lkstrp commented Feb 13, 2026

Thanks @lukasschirren ! I digged into this deeper, thanks for a useful fix!

I pushed a couple of changes which are mainly generalizations. I hope you did not mid. Also this is applied to carriers and bus_carriers now. The API change I added is that you now also need to pass nice_names=True, otherwise the nice_name sanitization is not run.

Let me know what you think

@lukasschirren
Copy link
Copy Markdown
Contributor Author

Thank you @lkstrp! The generalisations make sense and I agree with the nice_names fix. Happy with the changes

@lkstrp lkstrp enabled auto-merge (squash) February 13, 2026 11:52
@lkstrp lkstrp merged commit 409eee2 into PyPSA:master Feb 13, 2026
26 checks passed
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.

nice_names adds "residential" prefix to some bus_carrier display names -> energy_balance filtering and unit lookup fail

2 participants