[BUG]Business Hourly Reporting
Describe the bug
Using business hours fails when there are gaps in the data. Even when the hours are within "business hours".
Another interesting component of this issue is that the errors say that interval with freq="h" could not be filled, even though I set a freq of "BH". Below is the code to get the series (just to show that freq="BH"), and then the error.
def get_series(data, target_col: str = None, is_scaler: bool = True):
filler = MissingValuesFiller()
filler_kwargs = dict(
df=data,
time_col="date",
value_cols=[target_col],
freq="BH",
fill_missing_dates=True,
)
try:
ticker_series = TimeSeries.from_dataframe(**filler_kwargs)
except ValueError:
# remove business days to allow base lib to assume freq
filler_kwargs.pop("freq")
ticker_series = TimeSeries.from_dataframe(**filler_kwargs)
To Reproduce Try creating a timeseries with the below data: 1hour.csv
Expected behavior I would expect the BH frequency to be detected and for that to be used.
System (please complete the following information):
- Python version: 3.9.13
- darts version: 0.20.0
Hi, I think this might be due to your DF not having evenly spaced timestamps - see for instance the difference between the last time stamp and the one before is 30 minutes:

You seem to have quite a few different time deltas in there:

Providing a data frame with hourly data would probably help and I hope solve the issue.
Closing for now. Pls re-open if needed @colin99d