Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 1.6 KB

File metadata and controls

32 lines (19 loc) · 1.6 KB

Extra effort

In this document we describe what we did to earn the bonus-point:

Refactoring

For the last submission, we did a lot of refactoring, especially the file Userinteraction.py. As we got as feedback via a GitHub-Issue, we had multiple functions that handled the menu and sub-menu choices with redundant and duplicate code. As improvement, we implemented dictionaries that handle the user choices and store the information about the next method to call. So we merged the functions : _handle_choice_main_menu, _handle_choice_general_information_menu, _handle_choice_custom_queries_menu, into a generic function _display_menu that also handles the printing of all menus. This made the code shorter and much easier to read.

Additionally we had two methods _get_lines_by_city_and_year and _get_lines_by_country_and_year that nearly did the same and had duplicate code. We also got this as feedback from a GitHub-Issue and fixed by merging them together and creating a new generic function.

Pylint

In PYLINT.MD, we identified and fixed over 28 issues. However, only 10 of these fixes were required.

Exceptions

We implemented one try and catch block as required. Additionally, we included two more for better error handling.

Unit tests

It was required that we implement one unit test with at least 4 test cases. However, we created two unit tests with ten test cases each.

Bubble Diagram

We developed an interactive world map illustrating pollution levels by city for a given year. This map is both visually appealing and functional, allowing users to explore pollution data effectively.