Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 HQTA Methodology Revisions #1252

Merged
merged 153 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
7f87713
add fixed peaks, test out stop-level averaging
edasmalchi Oct 3, 2024
ff8443a
fix example
edasmalchi Oct 3, 2024
7051570
even clearer
edasmalchi Oct 3, 2024
b25c1ab
fix exploding merge per Tiff suggestion
edasmalchi Oct 3, 2024
05c9482
remove debug
edasmalchi Oct 3, 2024
62b1e5d
add distance to sb125 path examples
edasmalchi Oct 4, 2024
621b2cc
clear map
edasmalchi Oct 4, 2024
0f83492
test scenarios, proceed with keeping multi-route aggregation
edasmalchi Oct 8, 2024
c41c4e0
update script and vars with seperate hq corr and major stop frequence…
edasmalchi Oct 8, 2024
5db76c5
switch prep pairwise to major stop precursors, also make threshold ho…
edasmalchi Oct 8, 2024
4f06b62
revise sjoin stops to use fixed peak
edasmalchi Oct 8, 2024
53211e1
debug script
edasmalchi Oct 9, 2024
6da262e
wip
edasmalchi Oct 9, 2024
a1911fe
reran gtfs digest portfolio w sept 2024 data
amandaha8 Oct 2, 2024
b17d47c
timestamp issue when comparing scheduled and rt lags
amandaha8 Oct 1, 2024
f814a3a
transit bunching 2 min approach, began work on agency metrics in pip…
amandaha8 Oct 1, 2024
e9deea6
fixing some weird github thing
amandaha8 Oct 2, 2024
edc9dc3
figuring out why merge_data segment speed portion wont run
amandaha8 Oct 2, 2024
bb6f702
testing my script for 2024 dates
amandaha8 Oct 3, 2024
fe0cd52
added agency metrics to makefile and concat func
amandaha8 Oct 4, 2024
55065f1
do not drop duplicates for feed to organization_name
Oct 4, 2024
f86e741
rerun crosswalk tables for all dates with additional integer coercing
Oct 4, 2024
2a69e4e
(remove): empty script
Oct 4, 2024
7ddeb71
use operator instead of agency for consistency in yml
Oct 4, 2024
721b5ba
switch ref from helpers to publsh_utils and remove it from segment_sp…
Oct 4, 2024
3298609
break out segment speeds time-series into tabular and geometry
Oct 4, 2024
6cc2365
add notebook for feeds to organizations
Oct 4, 2024
d57d448
add new script to Makefile
Oct 4, 2024
1e68877
turn sco list wide to long
KatrinaMKaiser Oct 4, 2024
ac9639c
remove printed contact info
KatrinaMKaiser Oct 4, 2024
0cca9e3
summer work dashboard refactor
shweta487 Oct 6, 2024
b9c1c2f
schedule stop metrics, backfill all dates
Sep 30, 2024
2f95b2f
remove flex and private datasets from published_operators.yml'
Sep 30, 2024
6e6fed3
deprecate old config.yml function
Sep 30, 2024
b47f494
add publish_utils for patching in previous dates and test on stops file
Oct 3, 2024
c0b656e
combine publish_utils and prep_traffic_ops and update data dict
Oct 3, 2024
680c154
(remove): publish_utils, combined into open_data_utils
Oct 3, 2024
e77233a
refactor create routes and add patching
Oct 4, 2024
605e2e5
(remove): open_data script, work it into metadata_update_pro script
Oct 4, 2024
bcd1eb3
add list of route_ids to scheduled stops, refactor geoportal routes l…
Oct 4, 2024
13ca9c0
update metadata with new columns for stops added
Oct 8, 2024
3d3eee0
clean up nb
edasmalchi Oct 9, 2024
4b2201b
change intersection buffer, use new trips_hr cols
edasmalchi Oct 10, 2024
007cf76
allow selecting either hq corridor or ms precursor
edasmalchi Oct 10, 2024
61731a0
run full pipeline, start qa
edasmalchi Oct 10, 2024
bc76154
wip
edasmalchi Oct 16, 2024
19d818d
wip
edasmalchi Oct 17, 2024
2e3d663
clear maps
edasmalchi Oct 17, 2024
40f64e2
confirm rail/ferry, exclude 3 ferry stops without bus/rail connections
edasmalchi Oct 18, 2024
7271792
update README with new frequency method, explainer
edasmalchi Oct 18, 2024
50a2351
add legislative districts to shared data, create crosswalk for operat…
Oct 9, 2024
67c64df
move district functions into _report_utils
Oct 10, 2024
4e7b5b6
(portfolio_utils): add yaml creation function, remove table styling f…
Oct 10, 2024
06b54c4
update district report to use functions
Oct 10, 2024
058a291
legislative districts GTFS digest
Oct 10, 2024
002a1ef
add legislative report notebook
Oct 10, 2024
159a267
break out git adds in Makefile
Oct 10, 2024
91556ff
add sample ymls
Oct 10, 2024
a159b72
start of notebook
csuyat-dot Aug 8, 2024
81305c6
testing reading in some fund request sheets from GCS, renaming cols a…
csuyat-dot Aug 8, 2024
f67780e
added list of file names, made function to read in/lightly clean data…
csuyat-dot Aug 9, 2024
7404771
testing loop to extract basename from excel files
csuyat-dot Aug 9, 2024
768ef6f
starting to look at individual fund request templates, will flag whic…
csuyat-dot Aug 13, 2024
e7ca357
created function that loops through list of files to determine if any…
csuyat-dot Aug 14, 2024
6eb5506
update function that returns tuple of list of good and bad files. muc…
csuyat-dot Aug 14, 2024
082bfdd
created a function that creates a dictionary of file names and cleane…
csuyat-dot Aug 14, 2024
3faec46
used loop to see each dataframe in one go, see what needs to be edite…
csuyat-dot Aug 14, 2024
0e8bb4b
added more steps to cleaning script to forward fill NaN values with p…
csuyat-dot Aug 14, 2024
3266117
cleaned DFs from good list that needed minor tweaking (removed some r…
csuyat-dot Aug 14, 2024
a3035f3
tested concat-ing all the dictionary dataframe values into a single DF
csuyat-dot Aug 14, 2024
f383c33
setting up cells to sum all the capital and operations columns
csuyat-dot Aug 14, 2024
14a8949
more cleaning to remove unnecessary rows from indiviaul DFs
csuyat-dot Aug 15, 2024
ef19a14
more cleaning and removing rows. testing melting to DF to be more tid…
csuyat-dot Aug 15, 2024
44c2648
more cleaning. testing .groupby().agg()
csuyat-dot Aug 15, 2024
ea1fbe9
testing altair charts
csuyat-dot Aug 15, 2024
825fbe1
started to explore the fund request files that need extra work. mappe…
csuyat-dot Aug 16, 2024
82a922c
still cleaing the bad files. using a lot of .read_excel() arguments
csuyat-dot Aug 16, 2024
a3b58f9
cleaned all the bad DFs except kern and ventura. was able to concat n…
csuyat-dot Aug 16, 2024
c13b75f
minor fixes. about to start cleanign ventura and kern
csuyat-dot Aug 16, 2024
be6c30d
splitting ventura data into multiple tables
csuyat-dot Aug 19, 2024
ae74bad
sucessfully merged the ventura TIRCP capital and operating DFs
csuyat-dot Aug 19, 2024
84d1820
cleaning the ventura zetcp capital DF, about to merge with rest of ve…
csuyat-dot Aug 19, 2024
6874de4
finished ventura DF, working on Kern, started function that reads in …
csuyat-dot Aug 19, 2024
24c6417
completed cleaning kern data. concat all the little DFs, added to oth…
csuyat-dot Aug 19, 2024
76fb018
trying to save as parquet, but fund souce column has some int from Me…
csuyat-dot Aug 19, 2024
695cc28
trying out different altair chart configs
csuyat-dot Aug 20, 2024
221eeba
adjusted values in merced and humboldt so parquet can save out, also …
csuyat-dot Aug 20, 2024
af0adfb
cleaned up some cleaning steps to not depend on numeric row index, re…
csuyat-dot Aug 20, 2024
77e3c4b
started to update the cleaning steps into individual functions. also …
csuyat-dot Aug 20, 2024
763a60c
completed converting cleaning functions for good DFs, now starting to…
csuyat-dot Aug 20, 2024
66527a3
ran everything in the NB, everything still works even with the new fu…
csuyat-dot Aug 20, 2024
7976c78
minor changes
csuyat-dot Aug 21, 2024
183ef1d
continued making functions out of the cleaning steps for problem DFs.…
csuyat-dot Sep 3, 2024
390cd48
completed adding all cleaning functions to script. also made function…
csuyat-dot Sep 3, 2024
fdfabcb
minor changes
csuyat-dot Sep 3, 2024
842b8a2
minor fixes to script. did full run, no errors. good to go
csuyat-dot Sep 3, 2024
a9186d9
removed all the old work and test functions. now reading in final cle…
csuyat-dot Sep 3, 2024
e27c801
testing chart sizes and adding data labels
csuyat-dot Sep 3, 2024
38d8b34
still experimenting with altair charts
csuyat-dot Sep 3, 2024
b9d7ec6
reorganizing some chart
csuyat-dot Sep 4, 2024
643c638
more cleaning in the NB
csuyat-dot Sep 4, 2024
70e0848
added chart showing funding amount by funding source
csuyat-dot Sep 5, 2024
f4ebbde
created charts showing the top RTPA that requetsed the most and shows…
csuyat-dot Sep 5, 2024
9a2ab9e
testing some charts for individual agencies for top RTPAs
csuyat-dot Sep 5, 2024
b86b41b
still trying to chart agenciesby RTPAs
csuyat-dot Sep 5, 2024
f9ffe72
got chart of all RTPAs and their agencies by project type and FY
csuyat-dot Sep 6, 2024
b7755e7
minor changes
csuyat-dot Sep 6, 2024
4d3e00e
tryign to get data labels on big chart. but looks like stacked bar ch…
csuyat-dot Sep 10, 2024
952ba90
got independent x labels for line charts, but seems like have to to k…
csuyat-dot Sep 10, 2024
cedcac9
added titles to charts
csuyat-dot Sep 10, 2024
365d8ab
fixing titles on the big charts
csuyat-dot Sep 10, 2024
4d89322
made data labels black
csuyat-dot Sep 11, 2024
120f240
fixed operating charts so its actually charting op data and not cap
csuyat-dot Sep 11, 2024
b40f81f
added data labels to other charts
csuyat-dot Sep 12, 2024
666f791
brining in rtpa/district/county crosswalk data. also testing to add d…
csuyat-dot Sep 16, 2024
57666ae
started to test having a drop down filter on the faceted charts
csuyat-dot Sep 18, 2024
aae2817
tryign to deal with white space and filter position
csuyat-dot Sep 18, 2024
b716069
minor cleaning to plot visuals. added points to line charts
csuyat-dot Sep 19, 2024
6d02a2e
trying to add filter selector to other charts
csuyat-dot Sep 20, 2024
1c0fa60
adjusted plot size
csuyat-dot Sep 24, 2024
52c1f16
set default filter to VCTC, RTPA with the most agencies
csuyat-dot Sep 24, 2024
e7eaadc
moved some charts around, started work on making a gradient line char…
csuyat-dot Sep 25, 2024
c0ea1fa
made a side-by-side chart of opX vs capX by agencies in RTPAs. per am…
csuyat-dot Sep 25, 2024
9224f9e
swapped axis on alot of charts to be more horizontal
csuyat-dot Sep 25, 2024
0f240cb
get HTML code to move filter to the side of plots. change side-by-sid…
csuyat-dot Sep 26, 2024
f13ec82
updated axis names and titles on side-by-side chart
csuyat-dot Sep 26, 2024
3b46352
renamed initial NB to explore. started new NB to be the final publish…
csuyat-dot Oct 7, 2024
4648f5c
started to organize the NB by sorting and commenting the variables. a…
csuyat-dot Oct 8, 2024
f47b837
started README.md in preparation to make jupyter book
csuyat-dot Oct 11, 2024
c280921
initial draft of read me compelted
csuyat-dot Oct 11, 2024
5293598
added site .yml to portfolio/sites folder
csuyat-dot Oct 11, 2024
a6fec54
added captions to each chart and added currency format to .mark_text()
csuyat-dot Oct 14, 2024
aec8838
minor adjustment, swapped capx and opx chart postiion
csuyat-dot Oct 14, 2024
4604e82
first build/deploy of NB to portfolio site
csuyat-dot Oct 14, 2024
3fd2a8d
changed title of NB to be different from the README title, also respo…
csuyat-dot Oct 14, 2024
a5bbf3e
finish analysis, move intermediate to gcs
edasmalchi Oct 16, 2024
d3514da
add housing units per request, fix paths
edasmalchi Oct 16, 2024
2902094
rerun
edasmalchi Oct 16, 2024
fa271a3
metrics agg different due to filters
amandaha8 Oct 7, 2024
996c435
checking marin county
amandaha8 Oct 8, 2024
c2b34eb
moved work to vp trips but still same results
amandaha8 Oct 14, 2024
b4338c0
added agency agg using vp trips in scripts and digest portfolio
amandaha8 Oct 17, 2024
e5ea6d9
forgot to add a script
amandaha8 Oct 17, 2024
cb92253
exploring what the RTPA list this site is using, also checking to see…
csuyat-dot Oct 14, 2024
91e5bb3
exploring the ntd id rtpa crosswalk. found some some agencies in the …
csuyat-dot Oct 15, 2024
4475198
reran nb
csuyat-dot Oct 16, 2024
6fd0806
exploring if placer/el dor agencies exist in the rtpa crosswalk, and …
csuyat-dot Oct 16, 2024
472997c
finalized the updated ntd id rtpa crosswalk. re-parameterized monthly…
csuyat-dot Oct 18, 2024
ba6a726
update with oct2024 date
tiffanychu90 Oct 18, 2024
58eac83
gtfs_funnel, segment_speeds for oct2024ab
tiffanychu90 Oct 18, 2024
6ab01bc
rt vs sched for oct2024ab
tiffanychu90 Oct 18, 2024
efafb9a
geoportal export for oct2024
tiffanychu90 Oct 18, 2024
b55bb6e
metadata update
tiffanychu90 Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
# To specify different Makefile: make build_parallel_corridors -f Makefile

build_portfolio_site:
#cd portfolio/ && pip install -r requirements.txt && cd ../
cd portfolio/ && pip install -r requirements.txt && cd ../
#need git rm because otherwise, just local removal, but git change is untracked
git rm portfolio/$(site)/ -rf
#git rm portfolio/$(site)/ -rf
python portfolio/portfolio.py clean $(site)
python portfolio/portfolio.py build $(site) --deploy
make git_check
git add portfolio/$(site)/*.yml portfolio/$(site)/*.md
git add portfolio/sites/$(site).yml
#make production_portfolio

git_check:
git add portfolio/$(site)/*.yml portfolio/$(site)/*.md
git_check_sections:
git add portfolio/$(site)/*.ipynb # this one is most common, where operators nested under district
#git add portfolio/$(site)/district_*/*.ipynb # this one less common, but it's district pages only
git add portfolio/sites/$(site).yml

git_check_no_sections:
git add portfolio/$(site)/district_*/*.ipynb # this one less common, but it's district pages only

build_competitive_corridors:
$(eval export site = competitive_corridors)
Expand Down Expand Up @@ -46,6 +47,8 @@ build_gtfs_digest:
#cd gtfs_digest/ && python deploy_portfolio_yaml.py && make assemble_data && cd ..
cd gtfs_digest/ && python deploy_portfolio_yaml.py
make build_portfolio_site
make git_check_sections


build_gtfs_digest_testing:
$(eval export site = gtfs_digest_testing)
Expand All @@ -57,7 +60,14 @@ build_district_digest:
$(eval export site = district_digest)
#cd data-analyses/rt_segment_speeds && pip install -r requirements.txt && cd ../_shared_utils && make setup_env && cd ..
make build_portfolio_site
git add portfolio/$(site)/district_*/*.ipynb
make git_check_no_sections

build_legislative_district_digest:
$(eval export site = legislative_district_digest)
#cd data-analyses/rt_segment_speeds && pip install -r requirements.txt && cd ../_shared_utils && make setup_env && cd ..
make build_portfolio_site
make git_check_no_sections


add_precommit:
pip install pre-commit
Expand Down
2 changes: 1 addition & 1 deletion _shared_utils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
setup(
name="shared_utils",
packages=find_packages(),
version="2.6",
version="2.8",
description="Shared utility functions for data analyses",
author="Cal-ITP",
license="Apache",
Expand Down
18 changes: 0 additions & 18 deletions _shared_utils/shared_utils/catalog_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Literal

import intake
import yaml
from omegaconf import OmegaConf # this is yaml parser

repo_name = "data-analyses/"
Expand All @@ -22,20 +21,3 @@ def get_catalog(catalog_name: Literal["shared_data_catalog", "gtfs_analytics_dat

else:
return intake.open_catalog(catalog_path)


def get_parameters(config_file: str, key: str) -> dict:
"""
Parse the config.yml file to get the parameters needed
for working with route or stop segments.
These parameters will be passed through the scripts when working
with vehicle position data.

Returns a dictionary of parameters.
"""
# https://aaltoscicomp.github.io/python-for-scicomp/scripts/
with open(config_file) as f:
my_dict = yaml.safe_load(f)
params_dict = my_dict[key]

return params_dict
6 changes: 6 additions & 0 deletions _shared_utils/shared_utils/gtfs_analytics_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,23 @@ rt_vs_schedule_tables:
sched_route_direction_metrics: "schedule_route_dir/schedule_route_direction_metrics"
vp_trip_metrics: "vp_trip/trip_metrics"
vp_route_direction_metrics: "vp_route_dir/route_direction_metrics"
vp_operator_metrics: "vp_operator/operator_metrics"
sched_stop_metrics: "schedule_stop/schedule_stop_metrics"
#vp_stop_metrics: "vp_stop/vp_stop_metrics" # WIP: transit bunching
schedule_rt_stop_times: "schedule_rt_stop_times"
early_trip_minutes: -5
late_trip_minutes: 5


digest_tables:
dir: ${gcs_paths.RT_SCHED_GCS}
route_schedule_vp: "digest/schedule_vp_metrics"
route_segment_speeds: "digest/segment_speeds"
route_segment_geometry: "digest/segment_speeds_geom"
operator_profiles: "digest/operator_profiles"
operator_routes_map: "digest/operator_routes"
operator_sched_rt: "digest/operator_schedule_rt_category"
operator_metrics: "digest/operator_metrics"
scheduled_service_hours: "digest/total_scheduled_service_hours"

stop_segments:
Expand Down
Loading
Loading