Skip to content

Commit 37701ef

Browse files
authored
Fix ridership in Dec 2025 (#159)
1 parent dd79a76 commit 37701ef

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

ingestor/chalicelib/ridership/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
RIDERSHIP_SUBWAY_CSV_REGEX = re.compile(r"(\d{4})\.(\d{1,2})\.(\d{1,2}) MBTA Gated Station Validations by line", re.I)
66

7-
CR_RIDERSHIP_ARCGIS_URL = "https://opendata.arcgis.com/api/v3/datasets/e2635c945f5b47a7923e0ee441b040c8_0/downloads/data?format=csv&spatialRefId=4326&where=1=1"
7+
CR_RIDERSHIP_ARCGIS_URL = "https://www.arcgis.com/sharing/rest/content/items/59b5c61e8e9f42f9a3745f7ad63d07d6/data?format=csv&spatialRefId=4326&where=1=1"
88

9-
CR_UPDATE_CACHE_URL = "https://hub.arcgis.com/api/download/v1/items/e2635c945f5b47a7923e0ee441b040c8/csv?redirect=false&layers=0&updateCache=true"
9+
CR_UPDATE_CACHE_URL = "https://hub.arcgis.com/api/download/v1/items/59b5c61e8e9f42f9a3745f7ad63d07d6/csv?redirect=false&layers=0&updateCache=true"
1010

1111
FERRY_UPDATE_CACHE_URL = "https://hub.arcgis.com/api/download/v1/items/ae21643bbe60488db8520cc694f882aa/csv?redirect=false&layers=0&updateCache=true"
1212

ingestor/chalicelib/ridership/ingest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Dict
2+
23
from mbta_gtfs_sqlite.models import Route
34

45
from ..gtfs.utils import bucket_by

ingestor/chalicelib/ridership/process.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
from tempfile import NamedTemporaryFile
12
from typing import Dict, Union
2-
import pandas as pd
3+
34
import numpy as np
5+
import pandas as pd
46
from pandas.tseries.holiday import USFederalHolidayCalendar
5-
from tempfile import NamedTemporaryFile
6-
77

88
unofficial_labels_map = {
99
"SL1": "741",
@@ -30,6 +30,7 @@
3030
"Franklin/Foxboro": "CR-Franklin",
3131
"Middleborough/Lakeville": "CR-Middleborough",
3232
"Fall.River/New.Bedford": "CR-NewBedford",
33+
"Fall River/New Bedford": "CR-NewBedford",
3334
"Lowell": "CR-Lowell",
3435
"Haverhill": "CR-Haverhill",
3536
"Kingston": "CR-Kingston",
@@ -45,6 +46,7 @@
4546
"F6": "Boat-F6",
4647
"F7": "Boat-F7",
4748
"F8": "Boat-F8",
49+
"F9": "Boat-F9",
4850
"Charlestown Ferry": "Boat-F4",
4951
"Hingham/Hull Ferry": "Boat-F1",
5052
"East Boston Ferry": "Boat-EastBoston",
@@ -231,7 +233,7 @@ def format_bus_data(path_to_excel_file: str):
231233
def format_cr_data(path_to_ridershp_file: str):
232234
ridership_by_route = format_ridership_csv(
233235
path_to_csv_file=path_to_ridershp_file,
234-
date_key="service_date",
236+
date_key="servicedate",
235237
route_key="line",
236238
count_key="estimated_boardings",
237239
route_ids_map=unofficial_cr_labels_map,

0 commit comments

Comments
 (0)