-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge dev into main #4
Open
ttqureshi
wants to merge
29
commits into
main
Choose a base branch
from
dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
… WeatherReporter once.
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
...