flexmeasures
flexmeasures copied to clipboard
Pandas reporter `final_df_output` event resolution
Add the field output_event_resolution
field to PandasReporterConfigSchema
used to set the event_resolution
of the final_df_output
. This is useful for cases in which we want to modify the event_resolution
using methods that are not part of timely-beliefs (e.g: resample).
In addition, this PR solves the issue of having NaN DataSources in the returned timely-beliefs.
Why can't we get the resolution of the final output from self.sensor.event_resolution
instead?
Why can't we get the resolution of the final output from
self.sensor.event_resolution
instead?
The idea is, by default, check that the output event_resolution == self.sensor.event_resolution
, happening in the Reporter
class. If we set the output event_resolution
to self.sensor.event_resolution
, we always bypass this check.
So now you can pass the output resolution explicitly, but it must match the output sensor resolution. ...
Can we think of some alternatives? Is this resolution only passed to make that check succeed? If so, maybe we want that check only on proper BeliefsDataFrames, and want to have a different check on regular DataFrames (maybe checking the index frequency instead)?
Can we think of some alternatives? Is this resolution only passed to make that check succeed? If so, maybe we want that check only on proper BeliefsDataFrames, and want to have a different check on regular DataFrames (maybe checking the index frequency instead)?
Good point! I've updated the code to update the event_resolution
of the output BeliefDataFrame to the event_start
frequency in case this doesn't match the output sensor's.