-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix timespan queries; Add applied project to roadway and transit feat…
…ures (#369) * Fix small bug in roadway deletion: modes not mode. * Fix #282 Log applied project name as feature-level variable - updates transit and roadway data models to add `projects` as string - updates add and change projects to append project name to `projects` - tests that it is appropriately logged * Fix #368 resiliently query to update headway when there are multiple entries per trip_id - Separately query timespans to enforce "or" logic - Separate querying of frequencies from querying of stoptimes so frequencies can return more than one entry - Separate GTFS and Wrangler Frequencies and Stoptime schemas for times: string in HH:MM --> datetime object - Add parser to parse strings to datetimes upon conversion to Wrangler table models: note that it will not correctly do H>24 :-( - Fix parsing of times to have consistent days - Make default arrival/departure and start_stop related to DEFAULT_TIMESPAN - Allow for single-digit hours - enforce str schema for time strings - raise TableValidationErrors for ValueError and TypeErrors * Other: - reduce some debugging noise
- Loading branch information
Showing
38 changed files
with
649 additions
and
525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
trip_id,headway_secs,start_time,end_time | ||
blue-1,600,00:04:00,06:00:00 | ||
blue-1,600,04:00:00,06:00:00 | ||
blue-1,1800,06:00:00,09:00:00 | ||
blue-2,900,9:00:00,20:00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pandera as pa | ||
|
||
# Define a general schema for any Series with time strings in HH:MM or HH:MM:SS format | ||
TimeStrSeriesSchema = pa.SeriesSchema( | ||
pa.String, | ||
pa.Check.str_matches(r"^(?:[0-9]|[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$|^24:00(?::00)?$"), | ||
coerce=True, | ||
name=None # Name is set to None to ignore the Series name | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.