Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into registre-arrets/pre…
Browse files Browse the repository at this point in the history
…mier-modele
  • Loading branch information
ptitfred committed Jan 20, 2025
2 parents 52dbc1c + 4f80099 commit d5cd80a
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<p>
<%= dgettext("validations-explanations", "UnusableTrip") %>
</p>
<table class="table">
<tr>
<th><%= dgettext("validations-explanations", "Object type") %></th>
<th><%= dgettext("validations-explanations", "Object ID") %></th>
</tr>

<%= for issue <- @issues do %>
<tr>
<td><%= issue["object_type"] %></td>
<td><%= issue["object_id"] %></td>
</tr>
<% end %>
</table>
3 changes: 2 additions & 1 deletion apps/transport/lib/transport_web/views/resource_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ defmodule TransportWeb.ResourceView do
"MissingId" => "_missing_id_issue.html",
"MissingName" => "_missing_name_issue.html",
"SubFolder" => "_subfolder_issue.html",
"NegativeStopDuration" => "_negative_stop_duration_issue.html"
"NegativeStopDuration" => "_negative_stop_duration_issue.html",
"UnusableTrip" => "_unusable_trip.html"
},
Transport.Validators.GTFSTransport.issue_type(issues.entries),
"_generic_issue.html"
Expand Down
4 changes: 2 additions & 2 deletions apps/transport/priv/gbfs_operators.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ url;operator
example.com;Example
api.cyclocity.fr;JC Decaux
api.saint-etienne-metropole.fr;Fifteen
backend.citiz.fr;Citiz
bdx.mecatran.com;Cykleo
bird.co;Bird
clermontferrand.publicbikesystem.net;Citybike
Expand All @@ -16,12 +17,11 @@ fifteen.site;Fifteen
getapony.com;Pony
lime.bike;Lime
media.ilevia.fr/opendata;Cykleo
mobi-iti-nam.okina.fr/api-proxy/api/gbfs/1.0/gbfs/velibeo_ecovelo/gbfs;Ecovélo
mobi-iti-nam.okina.fr/api-proxy/api/gbfs/1.0/gbfs/perivelo_ecovelo/gbfs;Ecovélo
nextbike.net;nextbike
smovengo.cloud;Fifteen
urbansharing.com/lovelolibreservice.fr;Citybike
voiapp.io;Voi
zoov.eu;Fifteen
zoov.io;Fifteen
zoov.site;Fifteen
_ecovelo/gbfs;Ecovélo
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Details for debugging purposes"
msgstr ""

#, elixir-autogen, elixir-format
msgid "UnusableTrip"
msgstr "A trip must visit more than one stop in stop_times.txt to be usable by passengers for boarding and alighting."
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ msgstr "Emplacement inconnu"
#, elixir-autogen, elixir-format
msgid "Details for debugging purposes"
msgstr "Détails à fin de débogage"

#, elixir-autogen, elixir-format
msgid "UnusableTrip"
msgstr "Un trajet doit passer par plus d’un arrêt dans stop_times.txt pour être utilisable par les voyageurs à la montée ou la descente."
4 changes: 4 additions & 0 deletions apps/transport/priv/gettext/validations-explanations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,7 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Details for debugging purposes"
msgstr ""

#, elixir-autogen, elixir-format
msgid "UnusableTrip"
msgstr ""
4 changes: 2 additions & 2 deletions apps/transport/priv/zfe_ids.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ siren;code;epci_principal;autres_siren
247200132;LE MANS;Le Mans Métropole;
200093201;LILLE;Métropole Européenne de Lille;
248719312;LIMOGES;Limoges Métropole;
200046977;LYON;Métropole de Lyon;
200046977;LYON;Métropole de Lyon;256900994
200054807;MARSEILLE-AIX EN PROVENCE;Métropole Aix-Marseille-Provence;
200039865;METZ;Metz Métropole;
243400017;MONTPELLIER;Montpellier Méditerranée Métropole;
Expand All @@ -40,5 +40,5 @@ siren;code;epci_principal;autres_siren
246700488;STRASBOURG;Eurométropole de Strasbourg;
248300543;TOULON;Métropole Toulon Provence Méditerranée;
253100986;TOULOUSE;Toulouse métropole;243100518
243700754;TOURS;Tours Métropole Val de Loire;
243700754;TOURS;Tours Métropole Val de Loire;200085108
245901160;VALENCIENNES;Valenciennes métropole;
10 changes: 9 additions & 1 deletion apps/transport/test/transport/csv_documents_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ defmodule Transport.CSVDocumentsTest do
# Check `operator` values. Prevent typos and ensure unique values.
# Detect things like `Cykleo` VS `Cykléo`.
for x <- operators, y <- operators, x != y do
assert String.jaro_distance(x, y) <= 0.75, "#{x} and #{y} look too similar. Is it the same operator?"
error_message = "#{x} and #{y} look too similar. Is it the same operator?"
assert String.jaro_distance(x, y) <= 0.75 || distinct_operators?(x, y), error_message
end

# Check `url` values. Make sure there is at most a single match per GBFS feed.
Expand All @@ -43,4 +44,11 @@ defmodule Transport.CSVDocumentsTest do
refute String.contains?(x, y), "#{x} is contained #{y}. A GBFS feed can only match for a single URL."
end
end

def distinct_operators?(x, y) do
[
["Citiz", "Citybike"]
]
|> Enum.member?(Enum.sort([x, y]))
end
end

0 comments on commit d5cd80a

Please sign in to comment.