flexmeasures.data.services.time_series
Functions
- flexmeasures.data.services.time_series.aggregate_values(bdf_dict: dict[Any, BeliefsDataFrame]) BeliefsDataFrame
- flexmeasures.data.services.time_series.drop_unchanged_beliefs(bdf: BeliefsDataFrame) BeliefsDataFrame
Drop beliefs that say the same as the belief right before them.
A belief is unchanged if the belief right before it, about the same event and from the same source, gives the same value for each cumulative probability. “Right before” is in belief-time order, among the beliefs already stored and the ones being saved together, so a value that changes and changes back is kept, also when the whole change arrives in one save. Of a run of equal beliefs, the earliest is kept, so a value is known from the moment it was first believed.
Quite useful function to prevent cluttering up your database with beliefs that remain unchanged over time, and to prevent duplicate key violations when re-running forecasters or reporters with identical data.