flexmeasures icon indicating copy to clipboard operation
flexmeasures copied to clipboard

Pandas reporter `final_df_output` event resolution

Open victorgarcia98 opened this issue 1 year ago • 4 comments

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.

victorgarcia98 avatar May 30 '23 21:05 victorgarcia98

Why can't we get the resolution of the final output from self.sensor.event_resolution instead?

Flix6x avatar May 30 '23 22:05 Flix6x

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.

victorgarcia98 avatar May 31 '23 07:05 victorgarcia98

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)?

Flix6x avatar May 31 '23 12:05 Flix6x

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.

victorgarcia98 avatar May 31 '23 21:05 victorgarcia98