#25 GRFS export TODOs
All checks were successful
Amarillo/amarillo-gitea/amarillo-core/pipeline/head This commit looks good
All checks were successful
Amarillo/amarillo-gitea/amarillo-core/pipeline/head This commit looks good
This commit is contained in:
parent
ebbbf28432
commit
25ac460836
|
|
@ -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 "
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue