From 1910610d293a2f43dba91e295fcb22f12d93a13d Mon Sep 17 00:00:00 2001 From: Quentin Godfroy Date: Thu, 12 Sep 2024 14:49:44 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Add=20Chartres=20P=C3=B4le=20d=E2=80=99?= =?UTF-8?q?=C3=A9changes=20=E2=80=93=20Compa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New location 74668 - 8772636 - FRJMZ --- stations.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/stations.csv b/stations.csv index 407d6a6..eec3993 100644 --- a/stations.csv +++ b/stations.csv @@ -70513,3 +70513,4 @@ id;name;slug;uic;uic8_sncf;latitude;longitude;parent_station_id;country;time_zon 74665;Camigliano;camigliano;;;39.54774;16.84898;;IT;Europe/Rome;t;f;f;t;f;f;;;f;;f;;f;;f;ITCIN;t;;f;;f;;f;;f;;f;;f;;;;;f;;f;;f;;f;;f;;f;f;;;;;;;;;;;;;;;;;;;;urn:trainline:public:nloc:csv74665; 74666;Recco Molo di Levante;recco-molo-di-levante;;;44.359234;9.141982;;IT;Europe/Rome;f;f;f;t;f;f;;;f;;f;;f;;f;;f;;f;;f;;f;;f;;f;8314739;t;;;;;f;;f;;f;;f;;f;;f;f;;;;;;;;;;;;;;;;;;;;urn:trainline:public:nloc:csv74666; 74667;Apricena Garganico;apricena-garganico;;;41.779016;15.445426;;IT;Europe/Rome;f;f;f;t;f;f;;;f;;f;;f;;f;;f;;f;;f;;f;;f;;f;8337003;t;;;;;f;;f;;f;;f;;f;;f;f;;;;;;;;;;;;;;;;;;;;urn:trainline:public:nloc:csv74667; +74668;Chartres Pôle d’échanges – Compa;chartres-pole-dechanges-compa;8772636;87726364;48.4464;1.4767;4029;FR;Europe/Paris;f;f;f;f;f;f;FRJMZ;;t;;f;;f;;f;;f;;f;;f;;f;;f;;f;;f;;;;;f;;f;;f;;f;;f;;f;f;;;;;;;;;;;;;;;;;;;;urn:trainline:public:nloc:csv74668; From 092945cd6122e7558cf13520a703ac33fe67982d Mon Sep 17 00:00:00 2001 From: Quentin Godfroy Date: Thu, 12 Sep 2024 14:49:44 +0200 Subject: [PATCH 2/2] Add unicity test for UIC codes --- test_data.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test_data.rb b/test_data.rb index 7b893d2..8386a99 100644 --- a/test_data.rb +++ b/test_data.rb @@ -404,7 +404,7 @@ def test_slugs_with_countries_have_country_hint end end - def test_uic + def test_uic_country STATIONS.each do |row| if !Constants::UIC_KNOWN_DISCREPANCIES.include?(row["id"]) && !row["uic"].nil? && @@ -415,6 +415,18 @@ def test_uic end end + def test_uic_unique + uic_list = Set.new + + STATIONS.each do |row| + if !row["uic"].nil? && row["same_as"].nil? + assert !uic_list.include?(row["uic"]), "Station #{row["name"]} (#{row["id"]}) has its UIC code (#{row["uic"]}) already in use." + + uic_list << row["uic"] + end + end + end + def test_uic8_sncf STATIONS.each do |row| uic8_sncf = row["uic8_sncf"] || "#{row["uic"]}x"