Skip to content
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

[FEATURE] Set Default timeindex in edisgo.set_time_series_active_power_predefined #456

Open
khelfen opened this issue Feb 17, 2025 · 0 comments · May be fixed by #457
Open

[FEATURE] Set Default timeindex in edisgo.set_time_series_active_power_predefined #456

khelfen opened this issue Feb 17, 2025 · 0 comments · May be fixed by #457
Assignees

Comments

@khelfen
Copy link
Collaborator

khelfen commented Feb 17, 2025

Is your feature request related to a problem? Please describe.
Currently, when using edisgo.set_time_series_active_power_predefined, if the timeindex is None within an Edisgo.Timeseries object and is not explicitly provided, the module imports data for the default year of the database. However, since edisgo.set_time_series_active_power_predefined does not set the timeindex, the resulting Edisgo.Timeseries object remains empty. This can cause confusion and unexpected behavior for users. Currently there is only a warning if timeindex is empty, but this does not solve the problem automatically and could disrupt workflows.

Describe the solution you'd like
If Edisgo.Timeseries.timeindex is empty, it should automatically be set to the default year of the database before importing data. This ensures that the imported time series data is correctly linked to a valid timeindex, preventing an empty Edisgo.Timeseries object.

This could be done here:

eDisGo/edisgo/edisgo.py

Lines 559 to 566 in a0e83c9

if self.timeseries.timeindex.empty:
logger.warning(
"When setting time series using predefined profiles it is better to "
"set a time index as all data in TimeSeries class is indexed by the"
"time index. You can set the time index upon initialisation of "
"the EDisGo object by providing the input parameter 'timeindex' or by "
"using the function EDisGo.set_timeindex()."
)

Describe alternatives you've considered

  • Requiring users to explicitly set the timeindex before calling edisgo.set_time_series_active_power_predefined, but this adds an extra step that could be handled internally.

Additional context
This feature would improve the robustness of the module by preventing unexpected empty time series results. It would also align with the existing behavior of importing data for the default database year.

@khelfen khelfen self-assigned this Feb 17, 2025
khelfen added a commit that referenced this issue Feb 17, 2025
- Automatically set `EDisGo.TimeSeries.timeindex` to the default year of the database if it is empty.  # - Added a logger warning to inform users about the default behavior and recommend setting the `timeindex` explicitly using
`EDisGo.set_timeindex()`.  # On branch feature/#456-feature-set-default-timeindex-in-edisgoset_time_series_active_power_predefined
@khelfen khelfen linked a pull request Feb 17, 2025 that will close this issue
12 tasks
khelfen added a commit that referenced this issue Feb 17, 2025
…-timeindex-in-edisgoset_time_series_active_power_predefined

Fix missing timeindex in set_time_series_active_power_predefined
khelfen added a commit that referenced this issue Feb 17, 2025
…-timeindex-in-edisgoset_time_series_active_power_predefined

Overwrite timeindex if given timeindex differs from existing timeinde…
khelfen added a commit that referenced this issue Feb 17, 2025
…-timeindex-in-edisgoset_time_series_active_power_predefined

add logging and correct timeindex variable handling
khelfen added a commit that referenced this issue Feb 19, 2025
…-timeindex-in-edisgoset_time_series_active_power_predefined

Feature/#456 feature set default timeindex in edisgoset time series active power predefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant