Skip to content

Commit

Permalink
using correct offset
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
  • Loading branch information
victorgarcia98 committed Mar 13, 2024
1 parent 4947ce3 commit 29baa64
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions flexmeasures/data/models/reporting/pandas_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ def _clean_belief_series(

belief_series = belief_series.to_frame("event_value")
if belief_horizon is not None:
belief_time = belief_series["event_start"] + belief_horizon
belief_time = (
belief_series["event_start"]
+ belief_series.event_resolution
- belief_horizon
)
belief_series["belief_time"] = belief_time
belief_series["cumulative_probability"] = 0.5
belief_series["source"] = self.data_source
Expand All @@ -164,7 +168,9 @@ def _clean_belief_dataframe(
# filing the missing indexes with default values:
if "belief_time" not in bdf.index.names:
if belief_horizon is not None:
belief_time = bdf["event_start"] + belief_horizon
belief_time = (
bdf["event_start"] + +bdf.event_resolution - belief_horizon
)
else:
belief_time = [belief_time] * len(bdf)
bdf["belief_time"] = belief_time
Expand Down

0 comments on commit 29baa64

Please sign in to comment.