Add per-agency overview metrics to feed gathering results#88
Add per-agency overview metrics to feed gathering results#88dan-mccabe merged 8 commits intomainfrom
Conversation
…ve to agency_overview.csv Agent-Logs-Url: https://github.com/NatLabRockies/routee-transit/sessions/88fb98a6-8a27-4521-bc2b-5beb365461e8 Co-authored-by: dan-mccabe <25916826+dan-mccabe@users.noreply.github.com>
…[dict] Agent-Logs-Url: https://github.com/NatLabRockies/routee-transit/sessions/88fb98a6-8a27-4521-bc2b-5beb365461e8 Co-authored-by: dan-mccabe <25916826+dan-mccabe@users.noreply.github.com>
dan-mccabe
left a comment
There was a problem hiding this comment.
I think I wasn't clear enough about how/where these changes should be made. The existing code for aggregating feeds and datasets under scripts/ reports similar metrics to these when gathering datasets. This agency information should be a supplement to the existing feeds and datasets tables, rather than compiled along with the full energy prediction pipeline.
When you do this aggregation by agency, make sure you are filtering for only bus trips to be counted (this is probably already done). If an agency has no bus trips, exclude it completely.
…or changes Agent-Logs-Url: https://github.com/NatLabRockies/routee-transit/sessions/c33d38c6-7199-4af4-8422-8cda942b91c4 Co-authored-by: dan-mccabe <25916826+dan-mccabe@users.noreply.github.com>
… consistent type handling Agent-Logs-Url: https://github.com/NatLabRockies/routee-transit/sessions/c33d38c6-7199-4af4-8422-8cda942b91c4 Co-authored-by: dan-mccabe <25916826+dan-mccabe@users.noreply.github.com>
Reworked in commit 88dfa46 (with follow-up cleanup in 198a59c). The agency metrics are now computed inside
All linting ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The existing
scripts/feeds/gather_feeds.pyscript reported feed-wide metrics infeeds.csvanddatasets.csv, but had no agency-level breakdown. This adds per-agency service metrics as a supplement to those existing tables, written to a newagencies.csvfile.New function:
compute_agency_metrics()Added to
scripts/feeds/gather_feeds.py. For each dataset processed, computes one record per agency containing:dataset_iddatasets.csvagency_idagency_nametrips_per_dayavg_trip_duration_minutesavg_trip_distance_milesOnly bus trips (
route_type == 3) are counted. Agencies with no bus service are excluded entirely.Updated
process_dataset()Return type changed to
tuple[dict[str, Any], list[dict[str, Any]]]to carry per-agency metrics alongside the existing dataset summary.Updated
main()Collects agency metrics across all processed datasets and writes
agencies.csvalongside the existingfeeds.csvanddatasets.csv.