Open Flix6x opened 3 years ago
Proposed behaviour:
df = BeliefsDataFrame(some_timed_beliefs)
# The integrate method stands for taking the definite time integral with respect to the events
idf = df.integrate()
# The original sensor is retained
idf.sensor == df.sensor
# It follows that
idf.sensor.unit == df.sensor.unit
idf.sensor.event_resolution == df.sensor.event_resolution
# However, the unit and event resolution of the data have changed
idf.unit != df.sensor.unit
idf.event_resolution == timedelta(0)
Two notes:
df.unit
is a new BeliefsDataFrame property, next to df.sensor
and df.event_resolution
. We might want to use pint
for unit conversion.Finally, an example illustrating the belief timing sub-issue for (sequential) events A, B and C:
df
(free-form representation)
belief_time A B C
12:00 10 10
13:00 11 12
14:00 11
15:00 12
16:00 11
idf
(free-form representation)
belief_time A B C
12:00 10 10 20
13:00 11 23 33
14:00 34
15:00 12 24 35
16:00 23 34
I often need to take the time integral of a BeliefsDataFrame, for example, when converting from a power flow to accumulated demand. It would be nice to be able to do this out of the box. Some sub-issues:
timedelta(0)
(for instantaneous events).