Skip to content

import series only if not empty for oneport components#1528

Merged
lkstrp merged 6 commits intoPyPSA:masterfrom
yerbol-akhmetov:no_default_timeseries
Feb 5, 2026
Merged

import series only if not empty for oneport components#1528
lkstrp merged 6 commits intoPyPSA:masterfrom
yerbol-akhmetov:no_default_timeseries

Conversation

@yerbol-akhmetov
Copy link
Copy Markdown
Contributor

@yerbol-akhmetov yerbol-akhmetov commented Jan 19, 2026

Changes proposed in this Pull Request

Good day. I was working with PyPSA and noticed that get_clustering_from_busmap function that are used in PyPSA-Eur and PyPSA-Earth makes the clustered network have timeseries for storage units filled with default. As a result, it was not possible to use aggregateoneport function again after clustering, because timeseries were not empty. Currently, get_clustering_from_busmap do not import empty timeseries for generators, links, and lines. However, for one port components like storage_units we have empty timeseries added with _import_series_from_df method, which fills missing inputs with defaults. For p, it is 0. It might be a not a huge problem, because after clustering in PyPSA-X we have exporting to netcdf, which cleans up default timeseries data. But it seems not convenient if you would like to do further manipulations with clustered network.

image image

Is it intentional? Or we can keep one port components consistent with others and include if not df.empty? What do you think @lkstrp?

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.

Copy link
Copy Markdown
Member

@lkstrp lkstrp left a comment

Choose a reason for hiding this comment

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

Thanks @yerbol-akhmetov !

Could you add a minimal test and release notes for this as well?

@lkstrp lkstrp enabled auto-merge (squash) February 5, 2026 14:55
@lkstrp lkstrp disabled auto-merge February 5, 2026 16:06
@lkstrp lkstrp merged commit 530284b into PyPSA:master Feb 5, 2026
24 of 26 checks passed
@yerbol-akhmetov yerbol-akhmetov deleted the no_default_timeseries branch February 6, 2026 14:06
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.

2 participants