Skip to content

Commit 60b3313

Browse files
authored
Merge pull request #1533 from cal-itp/monthly_ntd_xwalk
Update ntd to rtpa crosswalk for NTD monthly Report
2 parents 1c9b35e + 1ffb36c commit 60b3313

File tree

59 files changed

+1831
-745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1831
-745
lines changed

ntd/_01_ntd_ridership_utils.py

Lines changed: 474 additions & 0 deletions
Large diffs are not rendered by default.

ntd/annual_ridership_report/annual_ridership_module.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import shutil
44
import sys
5-
import annual_ridership_module
5+
# import annual_ridership_module
66
sys.path.append("../") # up one level
77

88
import pandas as pd
@@ -102,6 +102,7 @@ def ntd_id_to_rtpa_crosswalk(split_scag:bool) -> pd.DataFrame:
102102
"San Bernardino": "San Bernardino County Transportation Authority",
103103
"Riverside": "Riverside County Transportation Commission",
104104
"Orange": "Orange County Transportation Authority",
105+
"Imperial": "Imperial County Transportation Commission"
105106
}
106107

107108
# Get agencies and RTPA name

ntd/deploy_portfolio_yaml.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@
1313

1414
from shared_utils import portfolio_utils
1515
from update_vars import GCS_FILE_PATH
16+
from _01_ntd_ridership_utils import ntd_id_to_rtpa_crosswalk # getting rtpa_name from dim_organizations now
1617

1718
PORTFOLIO_SITE_YAML = Path("../portfolio/sites/ntd_monthly_ridership.yml")
1819

1920
if __name__ == "__main__":
2021

21-
df = pd.read_parquet(
22-
f"{GCS_FILE_PATH}ntd_id_rtpa_crosswalk.parquet",
23-
columns = ["RTPA"]
24-
).drop_duplicates().sort_values("RTPA").reset_index(drop=True)
22+
df = ntd_id_to_rtpa_crosswalk(split_scag=True)["rtpa_name"].drop_duplicates().to_frame()
23+
# add row for LADPW
24+
ladpw= pd.DataFrame({"rtpa_name":["Los Angeles County Department of Public Works"]})
25+
df = pd.concat([df, ladpw], ignore_index=True).sort_values(by="rtpa_name")
2526

2627
portfolio_utils.create_portfolio_yaml_chapters_no_sections(
2728
PORTFOLIO_SITE_YAML,
2829
chapter_name = "rtpa",
29-
chapter_values =list(df.RTPA)
30+
chapter_values =list(df.rtpa_name)
3031
)
3132

0 commit comments

Comments
 (0)