Skip to content

Commit 8d806f3

Browse files
authored
Merge pull request #1530 from cal-itp/full_send_annual
Annual NTD ridership update part 2
2 parents 680f867 + caff773 commit 8d806f3

File tree

54 files changed

+501
-1542
lines changed

Some content is hidden

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

54 files changed

+501
-1542
lines changed

ntd/annual_ridership_report/annual_ridership_report.ipynb

Lines changed: 50 additions & 1118 deletions
Large diffs are not rendered by default.

ntd/annual_ridership_report/deploy_portfolio_yaml.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,21 @@
1111
sys.path.append("../") # up one level
1212

1313
from pathlib import Path
14-
14+
from calitp_data_analysis.tables import tbls
1515
import pandas as pd
1616
from shared_utils import portfolio_utils
17+
from siuba import _, collect, filter, select, show_query
1718
from update_vars import GCS_FILE_PATH
19+
from annual_ridership_module import ntd_id_to_rtpa_crosswalk
1820

1921
PORTFOLIO_SITE_YAML = Path("../../portfolio/sites/ntd_annual_ridership_report.yml")
2022

2123
# read in rtpa data from dim_orgs
2224
if __name__ == "__main__":
23-
df = (
24-
(
25-
tbls.mart_transit_database.dim_organizations()
26-
>> filter(
27-
_._is_current == True,
28-
# _.ntd_id_2022.notna(),
29-
_.rtpa_name.notna(),
30-
)
31-
>> select(_.name, _.ntd_id_2022, _.rtpa_name, _.mpo_name)
32-
>> collect()
33-
)["rtpa_name"]
34-
.sort_values()
35-
.drop_duplicates()
36-
.reset_index(drop=True)
37-
)
38-
25+
df = ntd_id_to_rtpa_crosswalk(split_scag=True)["rtpa_name"].drop_duplicates().to_frame()
26+
# add row for LADPW
27+
ladpw= pd.DataFrame({"rtpa_name":["Los Angeles County Department of Public Works"]})
28+
df = pd.concat([df, ladpw], ignore_index=True).sort_values(by="rtpa_name")
3929
portfolio_utils.create_portfolio_yaml_chapters_no_sections(
4030
PORTFOLIO_SITE_YAML, chapter_name="rtpa", chapter_values=list(df.rtpa_name)
4131
)

0 commit comments

Comments
 (0)