File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def fetch_nl_data(historic_or_forecast: str = "generation"):
6868
6969 # Define date range
7070 if historic_or_forecast == "generation" :
71- end_date = now
71+ end_date = now . replace ( hour = 0 ) + timedelta ( days = 1 ) # to ~ midnight tonight
7272 start_date = end_date - timedelta (days = 2 )
7373 else :
7474 # For forecast data, set start_date to 2 hours in the past from the current time
@@ -174,6 +174,10 @@ def fetch_nl_data(historic_or_forecast: str = "generation"):
174174 )
175175
176176 # remove any future data
177+ if historic_or_forecast == "generation" :
178+ # we pull a bit of future data, so update to only return historic values
179+ end_date = now
180+
177181 all_data = all_data [all_data ["target_datetime_utc" ] <= end_date ]
178182 all_data = all_data [all_data ["target_datetime_utc" ] >= start_date ]
179183
You can’t perform that action at this time.
0 commit comments