Skip to content

Commit

Permalink
Merge branch 'feature/#260-resample-time-series' into features/#276-i…
Browse files Browse the repository at this point in the history
…mprove-simple-example
  • Loading branch information
maike93he committed Aug 2, 2022
2 parents a1bf4db + 3c36a84 commit e2a2a30
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions edisgo/network/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2147,8 +2147,9 @@ def _check_if_components_exist(

def resample_timeseries(self, method: str = "ffill", freq: str = "15min"):
"""
Returns timeseries resampled from hourly resolution to 15 minute resolution.
#ToDo: Adjust docstring
Returns timeseries resampled to a desired resolution. Both up- and down-
sampling methods are available.
Parameters
----------
method : str, optional
Expand All @@ -2167,8 +2168,7 @@ def resample_timeseries(self, method: str = "ffill", freq: str = "15min"):
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.interpolate.html
freq : str, optional
Frequency that timeseries is resampled to. Can be any frequency up to one
hour. Offset aliases can be found here:
Frequency that timeseries is resampled to. Offset aliases can be found here:
https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
15 minutes is the default.
Expand Down Expand Up @@ -2219,8 +2219,10 @@ def resample_timeseries(self, method: str = "ffill", freq: str = "15min"):
setattr(
self, attr, df_dict[attr].resample(freq, closed="left").bfill()
)
else: # ToDo: Logger Warning: method not implemented
print(" ")
else:
raise NotImplementedError(
'Resampling method "{}" is not implemented.'.format(method)
)
else: # down-sampling
for attr in attrs:
setattr(
Expand Down

0 comments on commit e2a2a30

Please sign in to comment.