From 9a25ccf503513722529eb0b4603b9fc125816060 Mon Sep 17 00:00:00 2001 From: toravest Date: Fri, 23 May 2025 12:44:07 +0200 Subject: [PATCH] add validation so city2 name != city1 name --- notebooks/notebook_compare_one_day_data.ipynb | 5 +++++ notebooks/notebook_compare_one_week_data.ipynb | 5 +++++ notebooks/notebook_compare_statistic_data.ipynb | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/notebooks/notebook_compare_one_day_data.ipynb b/notebooks/notebook_compare_one_day_data.ipynb index 657b63d..f52e91e 100644 --- a/notebooks/notebook_compare_one_day_data.ipynb +++ b/notebooks/notebook_compare_one_day_data.ipynb @@ -137,6 +137,11 @@ "# User input the city, for the weather\n", "city_2 = input_place()\n", "\n", + "# Cheks that the two cities is not the same\n", + "while city_2.lower() == city_1.lower():\n", + " print(\"The two places must be different\")\n", + " city_2 = input_place()\n", + "\n", "# Start_date is the first timestamp, end_date is the last\n", "start_date, end_date = timestamps[0], timestamps[-1]\n", "\n", diff --git a/notebooks/notebook_compare_one_week_data.ipynb b/notebooks/notebook_compare_one_week_data.ipynb index f1a9a6d..34a6aa4 100644 --- a/notebooks/notebook_compare_one_week_data.ipynb +++ b/notebooks/notebook_compare_one_week_data.ipynb @@ -131,6 +131,11 @@ "# User input the city, for the weather\n", "city_2 = input_place()\n", "\n", + "# Cheks that the two cities is not the same\n", + "while city_2.lower() == city_1.lower():\n", + " print(\"The two places must be different\")\n", + " city_2 = input_place()\n", + "\n", "# Stores the values in the variables\n", "data_city_2, folder = fetch_time_data(unix_start_date, unix_end_date, city_2)" ] diff --git a/notebooks/notebook_compare_statistic_data.ipynb b/notebooks/notebook_compare_statistic_data.ipynb index 77afeb1..9821391 100644 --- a/notebooks/notebook_compare_statistic_data.ipynb +++ b/notebooks/notebook_compare_statistic_data.ipynb @@ -81,6 +81,11 @@ "# User input the city, for the weather\n", "city_2 = input_place()\n", "\n", + "# Cheks that the two cities is not the same\n", + "while city_2.lower() == city_1.lower():\n", + " print(\"The two places must be different\")\n", + " city_2 = input_place()\n", + "\n", "data_city_2, folder = fetch_stat_data(city_2)" ] },