Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
474 changes: 474 additions & 0 deletions ntd/_01_ntd_ridership_utils.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ntd/annual_ridership_report/annual_ridership_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import shutil
import sys
import annual_ridership_module
# import annual_ridership_module
sys.path.append("../") # up one level

import pandas as pd
Expand Down Expand Up @@ -102,6 +102,7 @@ def ntd_id_to_rtpa_crosswalk(split_scag:bool) -> pd.DataFrame:
"San Bernardino": "San Bernardino County Transportation Authority",
"Riverside": "Riverside County Transportation Commission",
"Orange": "Orange County Transportation Authority",
"Imperial": "Imperial County Transportation Commission"
}

# Get agencies and RTPA name
Expand Down
11 changes: 6 additions & 5 deletions ntd/deploy_portfolio_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@

from shared_utils import portfolio_utils
from update_vars import GCS_FILE_PATH
from _01_ntd_ridership_utils import ntd_id_to_rtpa_crosswalk # getting rtpa_name from dim_organizations now

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

if __name__ == "__main__":

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

portfolio_utils.create_portfolio_yaml_chapters_no_sections(
PORTFOLIO_SITE_YAML,
chapter_name = "rtpa",
chapter_values =list(df.RTPA)
chapter_values =list(df.rtpa_name)
)

Loading
Loading