Skip to content

Commit

Permalink
force sdac prices to be in sdac resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
fboerman committed Jan 9, 2025
1 parent c6c4c8d commit 0e9e6dd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions entsoe/entsoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)

__title__ = "entsoe-py"
__version__ = "0.6.16"
__version__ = "0.6.17"
__author__ = "EnergieID.be, Frank Boerman"
__license__ = "MIT"

Expand Down Expand Up @@ -1258,7 +1258,18 @@ def _query_day_ahead_prices(
end=end,
offset=offset
)
series = parse_prices(text)[resolution]
series_all = parse_prices(text)
series = series_all[resolution]
# For now Day Ahead SDAC should always return at least 60 min
# if there is either no 60 min data at all or 60 and 15/30 but none overlapping then force it to be 60 min
if resolution == '60min' and len(series_all['60min']) == 0:
for res in ['15min', '30min']:
if len(series_all[res]) != 0:
return series_all[res].resample('h').first()
elif resolution == '60min' and sum([len(x) > 0 for x in series_all.values()]) > 1:
for res in ['15min', '30min']:
if len(series_all['60min'].index.intersection(series_all[res])) == 0 and len(series_all[res]) > 0:
return pd.concat([series_all['60min'], series_all[res]]).resample('h').first()

if len(series) == 0:
raise NoMatchingDataError
Expand Down

0 comments on commit 0e9e6dd

Please sign in to comment.