Skip to content

Commit

Permalink
feat: add sync_stop_sequence to events table (#171)
Browse files Browse the repository at this point in the history
Add sync_stop_sequence field to performance manager based on OPMI request.

sync_stop_sequence is a generated stop_sequence value that is meant to be consistent across parent stations for different branch-routes on the same trunk-route.

Asana Task: https://app.asana.com/0/1205634094440864/1205670479715896
  • Loading branch information
rymarczy authored Oct 10, 2023
1 parent 5e69ee7 commit 1360e3d
Show file tree
Hide file tree
Showing 8 changed files with 268 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def upgrade() -> None:
sa.Column("pm_trip_id", sa.Integer(), nullable=False),
sa.Column("stop_sequence", sa.SmallInteger(), nullable=True),
sa.Column("canonical_stop_sequence", sa.SmallInteger(), nullable=True),
sa.Column("sync_stop_sequence", sa.SmallInteger(), nullable=True),
sa.Column("stop_id", sa.String(length=60), nullable=False),
sa.Column("parent_station", sa.String(length=60), nullable=False),
sa.Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@
, ve.stop_sequence
, ve.canonical_stop_sequence
, prev_ve.canonical_stop_sequence as previous_canonical_stop_sequence
, ve.sync_stop_sequence
, prev_ve.sync_stop_sequence as previous_sync_stop_sequence
, ve.stop_id
, prev_ve.stop_id as previous_stop_id
, ve.parent_station
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def upgrade() -> None:
sa.Column("pm_trip_id", sa.Integer(), nullable=False),
sa.Column("stop_sequence", sa.SmallInteger(), nullable=True),
sa.Column("canonical_stop_sequence", sa.SmallInteger(), nullable=True),
sa.Column("sync_stop_sequence", sa.SmallInteger(), nullable=True),
sa.Column("stop_id", sa.String(length=60), nullable=False),
sa.Column("parent_station", sa.String(length=60), nullable=False),
sa.Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@
, ve.stop_sequence
, ve.canonical_stop_sequence
, prev_ve.canonical_stop_sequence as previous_canonical_stop_sequence
, ve.sync_stop_sequence
, prev_ve.sync_stop_sequence as previous_sync_stop_sequence
, ve.stop_id
, prev_ve.stop_id as previous_stop_id
, ve.parent_station
Expand Down
1 change: 1 addition & 0 deletions python_src/src/lamp_py/performance_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Performance Manager is an application to measure rail performance on the MBTA tr
| stop_id | string | false | |
| stop_sequence | small integer | false | |
| canonical_stop_sequence | small integer | false | stop_sequence based on "typical" route trips as defined in the [static_route_patterns](#static_route_patterns) table|
| sync_stop_sequence | small integer | false | stop_sequence that is consistent across all branches of a trunk for a particular `parent_station`|
| parent_station | string | false | |
| previous_trip_stop_pm_event_id | integer | true | pm_event_id of previous stop of pm_trip_id grouping |
| next_trip_stop_pm_event_id | integer | true| pm_event_id of next stop of pm_trip_id grouping |
Expand Down
Loading

0 comments on commit 1360e3d

Please sign in to comment.