Closed ANIALLATOR114 closed 1 week ago
This pull request introduces a new feature to calculate and record delays for timeseries data. It involves significant changes to the project structure, including modifications to existing files and the addition of new files. The changes primarily focus on implementing asynchronous operations, improving database interactions, and adding new functionality for delay calculations.
sequenceDiagram
participant CLI
participant DelaysService
participant ScheduleService
participant RealTimeService
participant TSStopTimeRepository
CLI->>DelaysService: record_all_delays()
DelaysService->>ScheduleService: get_all_schedule_for_day_between_times()
ScheduleService-->>DelaysService: schedules
DelaysService->>RealTimeService: get_realtime_schedules_for_static_schedules()
RealTimeService-->>DelaysService: realtime_schedules
DelaysService->>DelaysService: filter_to_only_due_schedules()
DelaysService->>DelaysService: filter_to_only_schedules_with_updates()
DelaysService->>TSStopTimeRepository: add_many(ts_stop_times)
TSStopTimeRepository-->>DelaysService: confirmation
DelaysService-->>CLI: number of delays recorded
Change | Details | Files |
---|---|---|
Implement asynchronous operations for database interactions |
|
SimplyTransport/lib/stop_features_importer.py SimplyTransport/domain/schedule/repo.py SimplyTransport/lib/gtfs_realtime_importers.py |
Add new functionality for calculating and recording delays |
|
SimplyTransport/timescale/services/delays_service.py SimplyTransport/timescale/ts_stop_times/model.py SimplyTransport/cli.py SimplyTransport/domain/events/event_types.py |
Refactor and optimize existing code |
|
SimplyTransport/domain/services/schedule_service.py SimplyTransport/domain/realtime/realtime_schedule/model.py SimplyTransport/domain/services/realtime_service.py SimplyTransport/app.py |
Add database migrations for Timescale |
|
migrations/timescale/versions/2024_09_25-56f6a9c93651_adding_fields_for_ts_stop_times.py migrations/timescale/versions/2024_09_25-9fdbdd5e8677_id_sequence.py migrations/timescale/versions/2024_09_25-ffcf1e5100cf_removing_arrival_time.py |
Summary by Sourcery
Add a new feature to record stop time delays using a new CLI command and service. Refactor database operations to be asynchronous and consolidate schedule retrieval methods. Update the Timescale database schema with new fields and sequences. Enhance the RealTimeService with filtering capabilities. Update CI workflow and documentation to reflect these changes.
New Features:
Enhancements:
Build:
CI:
Documentation: