Values not getting pulled across Jan 1 / Dec 31 in moving window
As noted in !42 (merged) , a discontinuity appears at Jan 1 due to moving window not wrapping around the beginning/end of year
It looks like in filter_data_by_time
, we need to modify code at line 170-175
# grab data from the specified day of year and include leading
# and trailing values
dff = df.loc[
(df.index.dayofyear >= value - leading_values) &
(df.index.dayofyear <= value + trailing_values),
data_column_name]
I think we would either need to use more advanced functionality in python indexing. Could maybe see if there are some solutions within Pandas functions to do this. This feature might not exist though.
Alternatively, we could append copies of the data the length of leading/trailing values to before the beginning of the year and after the end of the year. Essentially, create records for doy of year to go negative and beyond 366. I'm guessing this simple copying of data might be the easiest approach. From what I can tell, this latter approach of temporarily copying data is what might be the way people have been doing this: https://stackoverflow.com/questions/72876190/rolling-windows-in-pandas-how-to-wrap-around-with-datetimeindex