From 25ac4608360c525cc0596b4e0207faeb443e8897 Mon Sep 17 00:00:00 2001 From: Francia Csaba Date: Thu, 18 Jan 2024 14:55:51 +0100 Subject: [PATCH] #25 GRFS export TODOs --- amarillo/app/models/Carpool.py | 1 + amarillo/app/models/gtfs.py | 3 +++ amarillo/app/services/trips.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/amarillo/app/models/Carpool.py b/amarillo/app/models/Carpool.py index 83aeddf..e57f6da 100644 --- a/amarillo/app/models/Carpool.py +++ b/amarillo/app/models/Carpool.py @@ -243,6 +243,7 @@ class Agency(BaseModel): #""" }) +# TODO: add driver model class and add it to carpool as an optional field class Carpool(BaseModel): id: str = Field( description="ID of the carpool. Should be supplied and managed by the " diff --git a/amarillo/app/models/gtfs.py b/amarillo/app/models/gtfs.py index 2189c61..0fbd2f2 100644 --- a/amarillo/app/models/gtfs.py +++ b/amarillo/app/models/gtfs.py @@ -1,6 +1,9 @@ from collections import namedtuple from datetime import timedelta +# TODO: create namedtuples for driver.txt and additional_ridesharing_info.txt +# TODO: add driver_id to GtfsTrip + GtfsFeedInfo = namedtuple('GtfsFeedInfo', 'feed_id feed_publisher_name feed_publisher_url feed_lang feed_version') GtfsAgency = namedtuple('GtfsAgency', 'agency_id agency_name agency_url agency_timezone agency_lang agency_email') GtfsRoute = namedtuple('GtfsRoute', 'agency_id route_id route_long_name route_type route_short_name') diff --git a/amarillo/app/services/trips.py b/amarillo/app/services/trips.py index 7bf7c4e..f30733f 100644 --- a/amarillo/app/services/trips.py +++ b/amarillo/app/services/trips.py @@ -16,6 +16,7 @@ logger = logging.getLogger(__name__) class Trip: + # TODO: add driver attributes, additional ridesharing info def __init__(self, trip_id, route_name, headsign, url, calendar, departureTime, path, agency, lastUpdated, stop_times, bbox): if isinstance(calendar, set): self.runs_regularly = True @@ -214,6 +215,7 @@ class TripTransformer: max([pt[0] for pt in path.coordinates]), max([pt[1] for pt in path.coordinates])) + # TODO: pass driver and ridesharing info object to the Trip constructor trip = Trip(trip_id, route_name, headsign, str(carpool.deeplink), carpool.departureDate, carpool.departureTime, carpool.path, carpool.agency, carpool.lastUpdated, stop_times, bbox) return trip