2021-01-09 16:20:23 +01:00
|
|
|
"""Globals used when testing."""
|
|
|
|
|
|
2021-02-02 11:29:27 +01:00
|
|
|
import datetime as dt
|
2021-01-09 16:34:42 +01:00
|
|
|
|
2026-11-23 18:06:53 +01:00
|
|
|
from velofy import config as pkg_config
|
2021-01-09 16:34:42 +01:00
|
|
|
|
2021-01-09 16:20:23 +01:00
|
|
|
|
|
|
|
|
# The day on which most test cases take place
|
|
|
|
|
YEAR, MONTH, DAY = 2016, 7, 1
|
2021-09-16 11:53:40 +02:00
|
|
|
# Same day as a `tuple`
|
|
|
|
|
DATE = (YEAR, MONTH, DAY)
|
2021-01-09 16:20:23 +01:00
|
|
|
|
2021-01-09 17:30:00 +01:00
|
|
|
# The hour when most test cases take place
|
|
|
|
|
NOON = 12
|
|
|
|
|
|
2021-02-02 11:29:27 +01:00
|
|
|
# `START` and `END` span 57 days, i.e., 8 full weeks plus 1 day
|
|
|
|
|
# => The maximum `train_horizon` is `8` as it needs full 7-day weeks
|
|
|
|
|
START = dt.datetime(YEAR, MONTH, DAY, pkg_config.SERVICE_START, 0)
|
|
|
|
|
_end = START + dt.timedelta(days=56) # `56` as `START` is not included
|
|
|
|
|
END = dt.datetime(_end.year, _end.month, _end.day, pkg_config.SERVICE_END, 0)
|
2021-01-09 16:34:42 +01:00
|
|
|
|
2021-02-01 11:32:10 +01:00
|
|
|
# Default time steps (in minutes), for example, for `OrderHistory` objects
|
2021-01-09 16:20:23 +01:00
|
|
|
LONG_TIME_STEP = 60
|
|
|
|
|
SHORT_TIME_STEP = 30
|
|
|
|
|
TIME_STEPS = (SHORT_TIME_STEP, LONG_TIME_STEP)
|
2021-02-01 11:32:10 +01:00
|
|
|
# Vertical `frequency`s are 7 days times the time steps per day (12 operating hours)
|
|
|
|
|
# => 84 and 168 for the `LONG_TIME_STEP` and `SHORT_TIME_STEP`
|
|
|
|
|
VERTICAL_FREQUENCY_LONG = 7 * 12
|
|
|
|
|
VERTICAL_FREQUENCY_SHORT = 7 * 24
|
2021-01-09 16:34:42 +01:00
|
|
|
|
|
|
|
|
# Default training horizons, for example, for
|
|
|
|
|
# `OrderHistory.make_horizontal_time_series()`
|
2021-02-02 11:29:27 +01:00
|
|
|
LONG_TRAIN_HORIZON = 8
|
2021-02-01 20:39:52 +01:00
|
|
|
SHORT_TRAIN_HORIZON = 2
|
2021-01-09 16:34:42 +01:00
|
|
|
TRAIN_HORIZONS = (SHORT_TRAIN_HORIZON, LONG_TRAIN_HORIZON)
|