Skip to content

Commit

Permalink
Merge pull request #1271 from cal-itp/scag-gtfs-2022
Browse files Browse the repository at this point in the history
Scag gtfs 2022
  • Loading branch information
edasmalchi authored Oct 29, 2024
2 parents d8ea4e4 + ca9471d commit 3e15df3
Show file tree
Hide file tree
Showing 3 changed files with 755 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conveyal_update/conveyal_vars.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime as dt

GCS_PATH = 'gs://calitp-analytics-data/data-analyses/conveyal_update/'
TARGET_DATE = dt.date(2023, 10, 18) # '2023-10-18' is most recent in Conveyal for the main 4 regions
TARGET_DATE = dt.date(2022, 9, 21) # 2022 date for SCAG request
OSM_FILE = 'us-west-latest.osm.pbf'
# http://download.geofabrik.de/north-america/us-west-latest.osm.pbf
# first download with wget...
Expand Down
14 changes: 10 additions & 4 deletions conveyal_update/evaluate_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,22 @@ def attach_transit_services(feeds_on_target: pd.DataFrame):
def report_undefined(feeds_on_target: pd.DataFrame):
fname = 'no_apparent_service.csv'
undefined = feeds_on_target.apply(check_defined_elsewhere, axis=1, args=[feeds_on_target]) >> filter(-_.service_any_feed)
print('these feeds have no service defined on target date, nor are their services captured in other feeds:')
print(undefined >> select(_.gtfs_dataset_name, _.service_any_feed))
print(f'saving detailed csv to {fname}')
undefined.to_csv(fname)
if undefined.empty:
print('no undefined service feeds')
else:
print(undefined.columns)
print('these feeds have no service defined on target date, nor are their services captured in other feeds:')
# gtfs_dataset_name no longer present, this whole script should probably be updated/replaced
# print(undefined >> select(_.gtfs_dataset_name, _.service_any_feed))
print(f'saving detailed csv to {fname}')
undefined.to_csv(fname)
return

if __name__ == '__main__':

feeds_on_target = get_feeds_check_service()
feeds_on_target = attach_transit_services(feeds_on_target)
print(f'feeds on target date shape: {feeds_on_target.shape}')
report_undefined(feeds_on_target)
feeds_on_target.to_parquet(f'{conveyal_vars.GCS_PATH}feeds_{TARGET_DATE.isoformat()}.parquet')

Loading

0 comments on commit 3e15df3

Please sign in to comment.