Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial destinations framework #2242

Merged
merged 5 commits into from
Oct 15, 2024
Merged

Initial destinations framework #2242

merged 5 commits into from
Oct 15, 2024

Conversation

digitalcora
Copy link
Contributor

@digitalcora digitalcora commented Oct 11, 2024

This adds a module which generates "destinations" from screen configs, the first step in the proposed real-time destinations logic. Both "permanent" (from typical route patterns) and "live" (from upcoming departures) destinations are generated. Initially there is only one possible state for a destination, NoDepartures. Following tasks will add more states and wire these into the DupNew screen variant.

This required a lot of refactoring and expansion of how we fetch data. Individual commit messages have the explanations of this. 📝


@digitalcora digitalcora changed the title Cfg slh Initial destinations framework Oct 11, 2024
@digitalcora digitalcora marked this pull request as ready for review October 11, 2024 21:15
@digitalcora digitalcora requested a review from a team as a code owner October 11, 2024 21:15
Copy link
Contributor

@cmaddox5 cmaddox5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The commit breakdown was very helpful. Just a couple non-blocking comments.

As a precursor to making RoutePatterns a first-class resource, this
frees up the `RoutePatterns.Parser` module name by moving some logic
specific to `stops_by_route_and_direction/2` (currently only used to
build GL E-ink line maps). This will let RoutePatterns follow the same
module naming convention as other resources.
This makes RoutePatterns a resource with its own attributes that can be
fetched directly, similar to Routes or Stops.
This creates a `line` field on Routes and populates it wherever Routes
are fetched.
This is in support of the new "real-time destinations" logic.

* RoutePatterns now have a `headsign`, which is the headsign of their
  representative trip.

* Trips now have a `pattern_headsign`, which is the headsign of their
  route pattern (if they have one), and a `representative_headsign`
  accessor, which returns the pattern headsign if there is one and the
  regular headsign if not.

* Departures now have a `representative_headsign` accessor, which
  delegates to the same-named accessor on the Trip of either their
  Prediction or Schedule, as appropriate.
This adds a module which generates "destinations" from screen configs,
the first step in the proposed "real-time destinations" logic. Both
"permanent" (from typical route patterns) and "live" (from upcoming
departures) destinations are generated. Initially there is only one
possible state for a destination, `NoDepartures`. Following tasks will
add more states and wire these into the `DupNew` screen variant.
@digitalcora digitalcora merged commit a924faa into main Oct 15, 2024
11 of 14 checks passed
@digitalcora digitalcora deleted the cfg-slh branch October 15, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants