~ihabunek/triglav

a128d7b3324bfe05384eab5648bf55e8df32a7c1 — Ivan Habunek 3 months ago 0d810ed
Better naming for matched/unmatched routes
M lib/triglav_web/controllers/zet/routes_controller.ex => lib/triglav_web/controllers/zet/routes_controller.ex +3 -3
@@ 152,12 152,12 @@ defmodule TriglavWeb.Zet.RoutesController do
      zet_variants =
        gtfs_distinct_trips
        |> Map.get(route.id)
        |> MapSet.new(&Map.get(&1, :stops))
        |> MapSet.new(&Map.get(&1, :stop_ids))

      counts = %{
        total: Enum.count(zet_variants),
        correct: MapSet.intersection(osm_variants, zet_variants) |> Enum.count(),
        incorrect: MapSet.difference(osm_variants, zet_variants) |> Enum.count()
        matched: MapSet.intersection(osm_variants, zet_variants) |> Enum.count(),
        unmatched: MapSet.difference(osm_variants, zet_variants) |> Enum.count()
      }

      hierarchy = make_hierarchy(route_relations)

M lib/triglav_web/templates/zet/routes/index.html.eex => lib/triglav_web/templates/zet/routes/index.html.eex +4 -4
@@ 86,11 86,11 @@
        <td>
          <%= render_relation_hierarchy(hierarchy) %>
        </td>
        <td class="<%= if counts.total == counts.correct and counts.incorrect == 0, do: "success" %>">
        <td class="no-wrap <%= if counts.total == counts.matched and counts.unmatched == 0, do: "success" %>">
          ZET: <%= counts.total %><br />
          Correct: <%= counts.correct %><br />
          <span class="<%= if counts.incorrect > 0, do: "text-red" %>">
            Incorrect: <%= counts.incorrect %>
          Matched: <%= counts.matched %><br />
          <span class="<%= if counts.unmatched > 0, do: "text-red" %>">
            Unmatched: <%= counts.unmatched %>
          </span>
        </td>
        <td>