Headway
1 Codebase

config.py

delivery/config.py · 31 lines · Download

1"""Paths and global constants. Everything reproducible starts from SEED."""2from pathlib import Path3 4ROOT = Path(__file__).resolve().parent.parent5DATA_RAW = ROOT / "data" / "raw"6DATA_PROC = ROOT / "data" / "processed"7MODELS = ROOT / "models"8OUTPUTS = ROOT / "outputs"9INSTANCES = ROOT / "instances"10FIXTURES = ROOT / "tests" / "fixtures"11 12SEED = 4213 14# --- data source (NYC TLC Trip Record Data) ---------------------------------15MONTH = "2022-01"16TRIP_URL = f"https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_{MONTH}.parquet"17ZONE_LOOKUP_URL = "https://d37ci6vzurychx.cloudfront.net/misc/taxi_zone_lookup.csv"18ZONE_SHAPES_URL = "https://d37ci6vzurychx.cloudfront.net/misc/taxi_zones.zip"19 20N_ZONES = 20                 # keep the 20 busiest zones21TARGET_TRIPS = 300_000       # subsample size after filtering22MIN_DURATION, MAX_DURATION = 1.0, 120.0   # minutes23MAX_SPEED_MPH = 60.0         # outlier filter on reported distance / duration24# split by day: first 3 weeks train (of which the last 2 days are validation), last week test25TRAIN_END = "2022-01-22"     # exclusive -> train+val = Jan 3 .. Jan 2126VAL_DAYS = ("2022-01-20", "2022-01-21")27TEST_START = "2022-01-24"    # test = Jan 24 .. Jan 31 (weekdays)28 29# --- van model --------------------------------------------------------------30VAN_FACTOR = 1.2             # documented assumption: van time = 1.2 x taxi time31WEEKDAY_NAMES = ["Mon", "Tue", "Wed", "Thu", "Fri"]