Skip to content

Commit

Permalink
FIX: Compressed GTFS Edge Case (#472)
Browse files Browse the repository at this point in the history
This change updates local folder creation for the compress-gtfs process to create a folder for an extra year into the future. This resolves an edge case caused by schedules released on new years eve.
  • Loading branch information
rymarczy authored Jan 1, 2025
1 parent 18b1fba commit 7df9a5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lamp_py/ingestion/compress_gtfs/schedule_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ def schedules_to_compress(tmp_folder: str) -> pl.DataFrame:
reverse=True,
)

# Insert extra year in case schedule is issued on last day of year
feed_years.insert(0, str(int(feed_years[0]) + 1))

for year in feed_years:
if not os.path.exists(os.path.join(tmp_folder, year)):
os.makedirs(os.path.join(tmp_folder, year))
Expand Down

0 comments on commit 7df9a5e

Please sign in to comment.