Add OrderHistory.avg_daily_demand()

- the method calculates the number of daily `Order`s in a `Pixel`
  withing the `train_horizon` preceding the `predict_day`
This commit is contained in:
Alexander Hess 2021-02-01 21:48:28 +01:00
commit cb7611d587
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
4 changed files with 83 additions and 11 deletions

View file

@ -82,6 +82,17 @@ def good_pixel_id(pixel):
return pixel.id # `== 1`
@pytest.fixture
def predict_at() -> dt.datetime:
"""`NOON` on the day to be predicted."""
return dt.datetime(
test_config.END.year,
test_config.END.month,
test_config.END.day,
test_config.NOON,
)
@pytest.fixture
def order_totals(good_pixel_id):
"""A mock for `OrderHistory.totals`.