From 78fc0d796794a9f5d5a078cc9d0f7842773acfc0 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Mon, 11 Mar 2024 20:12:27 -0400 Subject: [PATCH] Updating bus data to Jan 2024 (#955) --- common/constants/dates.ts | 2 +- server/bus/gen_bus_data.sh | 2 +- server/bus/setup_bus_input.sh | 5 +++-- server/chalicelib/date_utils.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/constants/dates.ts b/common/constants/dates.ts index 279cd28b3..b68e0effc 100644 --- a/common/constants/dates.ts +++ b/common/constants/dates.ts @@ -35,7 +35,7 @@ export const THREE_MONTHS_AGO_STRING = TODAY.subtract(90, 'days').format(DATE_FO const OVERVIEW_TRAIN_MIN_DATE = '2016-02-01'; const TRAIN_MIN_DATE = '2016-01-15'; const BUS_MIN_DATE = '2018-08-01'; -export const BUS_MAX_DATE = '2023-12-31'; +export const BUS_MAX_DATE = '2024-01-31'; export const BUS_MAX_DAY = dayjs(BUS_MAX_DATE); export const BUS_MAX_DATE_MINUS_ONE_WEEK = dayjs(BUS_MAX_DATE) .subtract(7, 'days') diff --git a/server/bus/gen_bus_data.sh b/server/bus/gen_bus_data.sh index b925bed88..0fd713a31 100755 --- a/server/bus/gen_bus_data.sh +++ b/server/bus/gen_bus_data.sh @@ -5,7 +5,7 @@ if [ -z "$routes" ]; then routes="1 4 9 15 16 17 19 21 22 23 28 32 34 39 41 45 47 55 57 61 66 70 71 73 77 85 86 89 91 92 104 109 111 114 116 117 170 220 221 222" fi -for y in `seq 2018 2023`; do +for y in `seq 2018 2024`; do for f in $(find data/input/$y/ -name '*.csv'); do echo "Generating stop data from $f" poetry run python bus2train.py $f data/output -r $routes diff --git a/server/bus/setup_bus_input.sh b/server/bus/setup_bus_input.sh index 88655088a..b4a04dd57 100755 --- a/server/bus/setup_bus_input.sh +++ b/server/bus/setup_bus_input.sh @@ -2,6 +2,7 @@ mkdir -p data/input +wget -N -O data/input/2024.zip https://www.arcgis.com/sharing/rest/content/items/96c77138c3144906bce93d0257531b6a/data wget -N -O data/input/2023.zip https://www.arcgis.com/sharing/rest/content/items/b7b36fdb7b3a4728af2fccc78c2ca5b7/data wget -N -O data/input/2022.zip https://www.arcgis.com/sharing/rest/content/items/ef464a75666349f481353f16514c06d0/data wget -N -O data/input/2021.zip https://www.arcgis.com/sharing/rest/content/items/2d415555f63b431597721151a7e07a3e/data @@ -10,10 +11,10 @@ wget -N -O data/input/2019.zip https://www.arcgis.com/sharing/rest/content/items wget -N -O data/input/2018.zip https://www.arcgis.com/sharing/rest/content/items/d685ba39d9a54d908f49a2a762a9eb47/data wget -N -O data/input/gtfs.zip https://cdn.mbta.com/MBTA_GTFS.zip -unzip -d data/input/MBTA_GTFS/ data/input/gtfs.zip +unzip -o -d data/input/MBTA_GTFS/ data/input/gtfs.zip cd data/input -for i in `seq 2018 2023`; do +for i in `seq 2023 2024`; do unzip -o -d $i $i.zip done diff --git a/server/chalicelib/date_utils.py b/server/chalicelib/date_utils.py index f702ee9cb..504507fa3 100644 --- a/server/chalicelib/date_utils.py +++ b/server/chalicelib/date_utils.py @@ -8,7 +8,7 @@ EASTERN_TIME = ZoneInfo("US/Eastern") # The most recent date for which we have monthly data -MAX_MONTH_DATA_DATE = "2023-12-31" +MAX_MONTH_DATA_DATE = "2024-01-31" def parse_event_date(date_str: str):