From 5794d9f8887c5aea141bccfb8d71ca3b3c4308d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Menou?= Date: Thu, 16 Jan 2025 17:38:36 +0100 Subject: [PATCH 1/3] Support new GTFS validation rule (#4416) --- .../resource/_gtfs_unusable_trip.html.heex | 16 ++++++++++++++++ .../lib/transport_web/views/resource_view.ex | 3 ++- .../en/LC_MESSAGES/validations-explanations.po | 4 ++++ .../fr/LC_MESSAGES/validations-explanations.po | 4 ++++ .../priv/gettext/validations-explanations.pot | 4 ++++ 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 apps/transport/lib/transport_web/templates/resource/_gtfs_unusable_trip.html.heex diff --git a/apps/transport/lib/transport_web/templates/resource/_gtfs_unusable_trip.html.heex b/apps/transport/lib/transport_web/templates/resource/_gtfs_unusable_trip.html.heex new file mode 100644 index 0000000000..08839e3ba1 --- /dev/null +++ b/apps/transport/lib/transport_web/templates/resource/_gtfs_unusable_trip.html.heex @@ -0,0 +1,16 @@ +

+ <%= dgettext("validations-explanations", "UnusableTrip") %> +

+ + + + + + + <%= for issue <- @issues do %> + + + + + <% end %> +
<%= dgettext("validations-explanations", "Object type") %><%= dgettext("validations-explanations", "Object ID") %>
<%= issue["object_type"] %><%= issue["object_id"] %>
diff --git a/apps/transport/lib/transport_web/views/resource_view.ex b/apps/transport/lib/transport_web/views/resource_view.ex index 25e4565a1a..cd1e0f4e25 100644 --- a/apps/transport/lib/transport_web/views/resource_view.ex +++ b/apps/transport/lib/transport_web/views/resource_view.ex @@ -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" diff --git a/apps/transport/priv/gettext/en/LC_MESSAGES/validations-explanations.po b/apps/transport/priv/gettext/en/LC_MESSAGES/validations-explanations.po index 094412efc1..1b167befb8 100644 --- a/apps/transport/priv/gettext/en/LC_MESSAGES/validations-explanations.po +++ b/apps/transport/priv/gettext/en/LC_MESSAGES/validations-explanations.po @@ -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." diff --git a/apps/transport/priv/gettext/fr/LC_MESSAGES/validations-explanations.po b/apps/transport/priv/gettext/fr/LC_MESSAGES/validations-explanations.po index 55adbefc56..e11d99bf4f 100644 --- a/apps/transport/priv/gettext/fr/LC_MESSAGES/validations-explanations.po +++ b/apps/transport/priv/gettext/fr/LC_MESSAGES/validations-explanations.po @@ -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." diff --git a/apps/transport/priv/gettext/validations-explanations.pot b/apps/transport/priv/gettext/validations-explanations.pot index e1e89c104f..ae81432ff4 100644 --- a/apps/transport/priv/gettext/validations-explanations.pot +++ b/apps/transport/priv/gettext/validations-explanations.pot @@ -145,3 +145,7 @@ msgstr "" #, elixir-autogen, elixir-format msgid "Details for debugging purposes" msgstr "" + +#, elixir-autogen, elixir-format +msgid "UnusableTrip" +msgstr "" From 4897113b913eb9f616e812030d5a33ef2ead24be Mon Sep 17 00:00:00 2001 From: Antoine Augusti Date: Fri, 17 Jan 2025 11:28:25 +0100 Subject: [PATCH 2/3] Identifiants ZFE : ajout syndicats pour Tours et Lyon (#4415) --- apps/transport/priv/zfe_ids.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/transport/priv/zfe_ids.csv b/apps/transport/priv/zfe_ids.csv index 7e22b5c2e2..8d027ad45b 100644 --- a/apps/transport/priv/zfe_ids.csv +++ b/apps/transport/priv/zfe_ids.csv @@ -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; @@ -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; From 4f8009934596a04b7ad4e4d0fb6ea8a1ea065a3f Mon Sep 17 00:00:00 2001 From: Antoine Augusti Date: Mon, 20 Jan 2025 13:02:21 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Mise=20=C3=A0=20jour=20op=C3=A9rateurs=20GB?= =?UTF-8?q?FS=20(#4418)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/transport/priv/gbfs_operators.csv | 4 ++-- apps/transport/test/transport/csv_documents_test.exs | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/transport/priv/gbfs_operators.csv b/apps/transport/priv/gbfs_operators.csv index 53cb327bc8..aae44271f0 100644 --- a/apps/transport/priv/gbfs_operators.csv +++ b/apps/transport/priv/gbfs_operators.csv @@ -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 @@ -16,8 +17,6 @@ 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 @@ -25,3 +24,4 @@ voiapp.io;Voi zoov.eu;Fifteen zoov.io;Fifteen zoov.site;Fifteen +_ecovelo/gbfs;Ecovélo diff --git a/apps/transport/test/transport/csv_documents_test.exs b/apps/transport/test/transport/csv_documents_test.exs index 24993ef940..b5c7267ae3 100644 --- a/apps/transport/test/transport/csv_documents_test.exs +++ b/apps/transport/test/transport/csv_documents_test.exs @@ -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. @@ -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