Skip to content

Conversation

@ttqureshi
Copy link
Owner

@ttqureshi ttqureshi commented Jul 15, 2024

To get the weather extremes of a year: python3 main.py ./ -e 2012:

Output:
<==== Report for the year 2012: ====>
Highest: 32C on June 21
Lowest: -4C on January 10
Humidity: 100% on January 18

To get the average stats of a month: python3 main.py ./ -a 2009/4

Output:

<==== Report for the month: April 2009 ====>
Highest Average: 17.2C
Lowest Average: 10.7C
Average Mean Humidity: 44.0%

To get the daily temperature bar charts of a month: python3 main.py ./ -c 2010/7

Output:

<==== Temperature Bar Charts for July 2010 ====>
1 +++++++++++++++++++++++++++ 27C
1 +++++++++++++++++ 17C
2 ++++++++++++++++++++++++ 24C
2 ++++++++++++++++++ 18C
3 ++++++++++++++++++++++++++ 26C
3 ++++++++++++++++++ 18C
4 ++++++++++++++++++++++++ 24C
4 +++++++++++++++ 15C
5 +++++++++++++++++++++++++ 25C
5 ++++++++++++++++ 16C
6 +++++++++++++++++++++++ 23C
6 ++++++++++++++++ 16C
7 +++++++++++++++++++++++ 23C
7 ++++++++++++++++ 16C
...

To get highest and lowest temperature bar chart of a day in one line: python3 main.py ./ -c 2010/7 --inline

Output:

<==== Temperature Bar Charts for July 2010 ====>
1 +++++++++++++++++ +++++++++++++++++++++++++++ 17C - 27C
2 ++++++++++++++++++ ++++++++++++++++++++++++ 18C - 24C
3 ++++++++++++++++++ ++++++++++++++++++++++++++ 18C - 26C
4 +++++++++++++++ ++++++++++++++++++++++++ 15C - 24C
5 ++++++++++++++++ +++++++++++++++++++++++++ 16C - 25C
6 ++++++++++++++++ +++++++++++++++++++++++ 16C - 23C
7 ++++++++++++++++ +++++++++++++++++++++++ 16C - 23C
8 ++++++++++++++++++ +++++++++++++++++++++++++++ 18C - 27C
9 +++++++++++++++++++ ++++++++++++++++++++++++++ 19C - 26C
10 ++++++++++++++++++++ +++++++++++++++++++++++++ 20C - 25C
...

Multiple reports at a time: python3 main.py ./ -c 2010/7 -a 2009/4 -e 2012 --inline

Output:

<==== Report for the year 2012: ====>
Highest: 32C on June 21
Lowest: -4C on January 10
Humidity: 100% on January 18

<==== Report for the month: April 2009 ====>
Highest Average: 17.2C
Lowest Average: 10.7C
Average Mean Humidity: 44.0%

<==== Temperature Bar Charts for July 2010 ====>
1 +++++++++++++++++ +++++++++++++++++++++++++++ 17C - 27C
2 ++++++++++++++++++ ++++++++++++++++++++++++ 18C - 24C
3 ++++++++++++++++++ ++++++++++++++++++++++++++ 18C - 26C
4 +++++++++++++++ ++++++++++++++++++++++++ 15C - 24C
5 ++++++++++++++++ +++++++++++++++++++++++++ 16C - 25C
6 ++++++++++++++++ +++++++++++++++++++++++ 16C - 23C
7 ++++++++++++++++ +++++++++++++++++++++++ 16C - 23C
8 ++++++++++++++++++ +++++++++++++++++++++++++++ 18C - 27C
9 +++++++++++++++++++ ++++++++++++++++++++++++++ 19C - 26C
10 ++++++++++++++++++++ +++++++++++++++++++++++++ 20C - 25C
...

ttqureshi and others added 29 commits June 11, 2024 13:57
- moved main.py outside of code_files directory and renamed it to weatherman.py
- Computations -> ReportCalculator (renamed)
- Parser -> WeatherParser (renamed)
- separate class for constants
- Using WeatherReporter for printing only. All calculations moved to ReportCalculator class
- Handled missing values in data
- If user asks for a year or month against which there is no record in the data, shows a message No Record Found instead of throwing error
This method checks for the equality of two objects of type WeatherReading
The older condition 'value is not None' isn't sufficient. The value can be empty (string) as well, in that case this method should not return anything. Other catch was 0 values. Therefore, first condition 'if value' filters out None and empty stirngs and the subsequent condition 'value == 0' lets 0's to pass the condition since they are desired.
@ttqureshi ttqureshi requested a review from irtazaakram July 15, 2024 11:22
@ttqureshi ttqureshi self-assigned this Sep 4, 2024
@ttqureshi ttqureshi marked this pull request as draft March 12, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants