Skip to content

Commit

Permalink
refactor: add 2x build functions to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward-Jackson-ONS committed Feb 26, 2024
1 parent 05b03d4 commit 2965ca6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Initial pipeline to obtain project resources/data."""
from src.bus_metrics.setup.ingest_static_data import StaticDataIngest
from src.bus_metrics.setup.ingest_realtime_data import RealtimeDataIngest
from src.bus_metrics.setup.build_lookup import create
from src.bus_metrics.aggregation.build_schedules import Schedule_Builder
from datetime import datetime
import logging
import os
Expand Down Expand Up @@ -88,6 +90,23 @@ def data_folder(logger: logging.Logger) -> None:
logger.warning("##Amend toml to download sample##")
logger.warning("##Use shell script to download heavy##")

try:
logger.info("Building stops-geography lookup table")
# TODO: naming/access of function to be improved
create()
except Exception as e:
logger.warning(f"Build error: {e}")
pass

try:
schedule_builder = Schedule_Builder()
logger.info("Preparing punctuality data by stop")
# TODO: naming/access of method to be improved
schedule_builder.run()
except Exception as e:
logger.warning(f"Build error: {e}")
pass

logger.info("-----------------------------")
logger.info("-------SETUP COMPLETED-------")
logger.info("-----------------------------")

0 comments on commit 2965ca6

Please sign in to comment.