Skip to content

Commit

Permalink
Merge pull request #1151 from cal-itp/quarterly-performance-metrics-r…
Browse files Browse the repository at this point in the history
…eport

Refactor: Quarterly performance metrics report
  • Loading branch information
tiffanychu90 authored Jun 21, 2024
2 parents 80f6069 + a130209 commit 3e41c48
Show file tree
Hide file tree
Showing 18 changed files with 7,397 additions and 2,923 deletions.
10 changes: 6 additions & 4 deletions _shared_utils/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
-e .
altair==5.3.0
altair-transform==0.2.0
gtfs-segments==0.1.0
pyairtable==2.2.2
great-tables==0.4.0
polars==0.20.16
great_tables==0.6.1
omegaconf==2.3.0 # better yaml configuration
altair==5.3.0
altair-transform==0.2.0
polars==0.20.29
quarto-cli==1.4.554
quarto==0.1.0
14 changes: 13 additions & 1 deletion quarterly_performance_objective/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
quarterly_performance_report:
#cd ../rt_segment_speeds/ && make && pip install -r requirements.txt && cd ..
python clean_data.py
#cd ../ && make build_quarterly_performance_metrics -f Makefile
python compile_time_series.py
#cd ../ && make build_quarterly_performance_metrics -f Makefile

quarto_report:
# this renders as html
#quarto render report.ipynb --execute
# to convert ipynb to qmd
quarto convert report.ipynb
# to convert qmd to ipynb
quarto convert report.qmd
#https://quarto.org/docs/computations/parameters.html#jupyter couldn't get this to work
#quarto render report.qmd --execute-params params.yml
quarto publish report.qmd
20 changes: 7 additions & 13 deletions quarterly_performance_objective/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Mass Transit Performance Objectives

## Performance Objective 01: Increase total amount of service on the SHN and reliability of that service by 2024
## Performance Objective 01: Increase total amount of service on the SHN and reliability (speed) of that service

Transit routes along the SHN can be categorized into 3 groups:

1. **On SHN** - where at least 20% of the transit route runs the SHN (within 50 ft)
1. **Intersects SHN** - where at least 35% of the transit route runs within 0.5 mile of the SHN.
1. **Intersects SHN** - where at least 20% of the transit route runs within 0.5 mile of the SHN.
1. **Other** - all other transit routes.


Expand All @@ -14,18 +14,12 @@ Initially presented for the Planning and Modal Advisory Committee (PMAC).
## Workflow
### Data Generation

1. [Aggregate from shape level to route level](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/A1_scheduled_route_level_df)
1. [Generate processed data for categories and service hours](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/A2_generate_routes_on_shn_data.py) with GTFS schedule data
1. [Categorize routes into 3 groups](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/A3_categorize_routes.py)
1. [Merge service hours and speeds and estimate delay](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/A4_add_route_speeds.py)
1. [Clean and process data each month](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/clean_data.py)
1. [Compile monthly data into time-series](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/compile_time_series.py)

### Helper Scripts for Reports
1. [data prep functions](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/report_metrics.py)
1. [chart functions](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/report_charts.py)
### Helper Functions
[Categorize routes](https://github.com/cal-itp/data-analyses/blob/main/rt_segment_speeds/segment_speed_utils/parallel_corridors.py) into on SHN, parallel / intersects SHN, or other.

### Reports

Create a report of current quarter's snapshot as well as a historical comparison of quarterly metrics report.

1. [current quarter's snapshot](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/current_quarter_report.ipynb)
1. [historical comparison](https://github.com/cal-itp/data-analyses/blob/main/quarterly_performance_objective/historical_service_hours_v2.ipynb)
Create a report of current quarter's snapshot with a historical comparison.
Loading

0 comments on commit 3e41c48

Please sign in to comment.