Skip to content

Commit

Permalink
add validation so city2 name != city1 name
Browse files Browse the repository at this point in the history
  • Loading branch information
toravest committed May 23, 2025
1 parent 19fd744 commit 9a25ccf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions notebooks/notebook_compare_one_day_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions notebooks/notebook_compare_one_week_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
Expand Down
5 changes: 5 additions & 0 deletions notebooks/notebook_compare_statistic_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
Expand Down

0 comments on commit 9a25ccf

Please sign in to comment.