pywr / pywr-next

An experimental repository exploring ideas for a major revision to Pywr using Rust as a backend.
6 stars 4 forks source link

Extend timeseries data when up-sampling it to a higher frequency #155

Open Batch21 opened 3 months ago

Batch21 commented 3 months ago

As the up-sampling uses a forward-fill strategy, this should occur when the model end date is later than the last data entry but still within the duration of that entry.

For example, if the model has a daily timestep and an end date of 10-01-2020 and the the timeseries data has a weekly frequency and a final entry for 09-01-2020, then the resample should produce a value for 10-01-2020 as it is within a week of 09-01-2020.

Currently it does not as the polars resampling is truncated by the bounds of the input data. A solution would be to extend the input timeseries by with another entry. Because forward-fill is used the values for the entry could probably be NaNs.