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

manually override stop ordering for green line branch merging #653

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions apps/state/lib/state/stops_on_route.ex
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,123 @@ defmodule State.StopsOnRoute do

def merge_ids([], _), do: []

def merge_ids(
[
["place-unsqu", "place-lech", "place-spmnl", "place-north"],
[
"place-gover",
"place-pktrm",
"place-boyls",
"place-armnl",
"place-coecl",
"place-hymnl",
"place-kencl",
"place-fenwy",
"place-longw",
"place-bvmnl",
"place-brkhl",
"place-bcnfd",
"place-rsmnl",
"place-chhil",
"place-newto",
"place-newtn",
"place-eliot",
"place-waban",
"place-woodl",
"place-river"
]
],
_
) do
[
"place-unsqu",
"place-lech",
"place-spmnl",
"place-north",
"place-gover",
"place-pktrm",
"place-boyls",
"place-armnl",
"place-coecl",
"place-hymnl",
"place-kencl",
"place-fenwy",
"place-longw",
"place-bvmnl",
"place-brkhl",
"place-bcnfd",
"place-rsmnl",
"place-chhil",
"place-newto",
"place-newtn",
"place-eliot",
"place-waban",
"place-woodl",
"place-river"
]
end

def merge_ids(
[
[
"place-mdftf",
"place-balsq",
"place-mgngl",
"place-gilmn",
"place-esomr",
"place-lech",
"place-spmnl",
"place-north"
],
[
"place-gover",
"place-pktrm",
"place-boyls",
"place-armnl",
"place-coecl",
"place-prmnl",
"place-symcl",
"place-nuniv",
"place-mfa",
"place-lngmd",
"place-brmnl",
"place-fenwd",
"place-mispk",
"place-rvrwy",
"place-bckhl",
"place-hsmnl"
]
],
_
) do
[
"place-mdftf",
"place-balsq",
"place-mgngl",
"place-gilmn",
"place-esomr",
"place-lech",
"place-spmnl",
"place-north",
"place-gover",
"place-pktrm",
"place-boyls",
"place-armnl",
"place-coecl",
"place-prmnl",
"place-symcl",
"place-nuniv",
"place-mfa",
"place-lngmd",
"place-brmnl",
"place-fenwd",
"place-mispk",
"place-rvrwy",
"place-bckhl",
"place-hsmnl"
]
end

def merge_ids(lists_of_ids, override_lists) do
sorted_lists = Enum.sort_by(lists_of_ids, &list_merge_key/1, &>=/2)
# overrides should be short or empty, so putting that first with ++ is
Expand Down
Loading