{"action":"created","comment":{"url":"https://api.github.com/repos/arbisoft/the-lab/pulls/comments/34126069","id":34126069,"diff_hunk":"@@ -0,0 +1,233 @@\n+# -*- coding: utf-8 -*-\n+import os\n+import sys\n+\n+\n+# class that will contain the data entries for organized functioning\n+class DetailInfo:\n+\n+    def __init__(self, date, maxtemp, mintemp, maxhumid, minhumid):\n+        self.date = date\n+        self.maxTemp = maxtemp\n+        self.minTemp = mintemp\n+        self.maxHumid = maxhumid\n+        self.minHumid = minhumid\n+\n+\n+# contains the logic if user selects option one\n+# that is generation of Annual report\n+def option1():\n+    print(\"Year     MaxTemp     MinTemp     MaxHumid    MinHumid\")\n+    print(\"-----------------------------------------------------\")\n+    # going through every year\n+    for year in yearlist:\n+\n+        # getting list against year from dictionary\n+        list_cur = my_dict[year]\n+\n+        # Sorting list on Max Temp\n+        list_cur.sort(key = lambda x: x.maxTemp, reverse = True)\n+        # this loop will find the true value\n+        # because there are some dummy values\n+        # this wont be inefficient\n+        #  because value will be found in less than 10 tries\n+        pos = 0\n+        while True:\n+            if (list_cur[pos].maxTemp == \"Max TemperatureC\") or \\\n+                    (list_cur[pos].maxTemp == \"\"):\n+                pos = pos + 1\n+            else:\n+                maxT = list_cur[pos].maxTemp\n+                break\n+\n+        # Sorting list on Min Temp\n+        list_cur.sort(key = lambda x: x.minTemp, reverse = False)\n+        pos = 0\n+        # same upper Loop\n+        while True:\n+            if (list_cur[pos].minTemp == \"Min TemperatureC\") or \\\n+                    (list_cur[pos].minTemp == \"\"):\n+                pos = pos + 1\n+            else:\n+                minT = list_cur[pos].minTemp\n+                break\n+\n+\n+        # Sorting list on Min humidity\n+        list_cur.sort(key = lambda x: x.minHumid, reverse = False)\n+        pos = 0\n+        # same loop\n+        while True:\n+            if (list_cur[pos].minHumid == \" Min Humidity\") or \\\n+                    (list_cur[pos].minHumid == \"\"):\n+                pos = pos + 1\n+            else:\n+                minH = list_cur[pos].minHumid\n+                break\n+\n+        # Sorting list on Max humidity\n+        list_cur.sort(key = lambda x: x.maxHumid, reverse = True)\n+        pos = 0\n+        # same loop\n+        while True:\n+            if (list_cur[pos].maxHumid == \"Max Humidity\") or \\\n+                    (list_cur[pos].maxHumid == \"\"):\n+                pos = pos + 1\n+            else:\n+                maxH = list_cur[pos].maxHumid\n+                break\n+\n+        print(year + \"       \" + maxT + \"          \" + minT +\n+              \"          \" + maxH + \"           \" + minH)\n+\n+\n+# contains the logic if user selects option two\n+# that is generation of Yearly Max temp report\n+def option2():\n+    print(\"Year          Date        Max temp\")\n+    print(\"-------------------------------\")\n+    # going through every year\n+    for year in yearlist:\n+        # getting list against year from dictionary\n+        list_cur = my_dict[year]\n+\n+        # Sorting list on Max Temp\n+        list_cur.sort(key = lambda x: x.maxTemp, reverse = True)\n+\n+        # this loop will find the true value\n+        pos = 0\n+        while True:\n+            if (list_cur[pos].maxTemp == \"Max TemperatureC\") or \\\n+                    (list_cur[pos].maxTemp == \"\"):\n+                pos = pos + 1\n+            else:\n+                print(year + \"       \" + list_cur[pos].date +\n+                      \"          \" + list_cur[pos].maxTemp)\n+                break\n+\n+\n+# contains the logic if user selects option two\n+# that is generation of Yearly Min temp report\n+def option3():\n+    print(\"Year          Date        Min Temp\")\n+    print(\"-----------------------------------\")\n+\n+    # going through every year\n+    for year in yearlist:\n+        # getting list against year from dictionary\n+        list_cur = my_dict[year]\n+        # Sorting list on Max Temp\n+        list_cur.sort(key = lambda x: x.minTemp, reverse = False)\n+\n+        # this loop will find the true value\n+        pos = 0\n+        while True:\n+            if (list_cur[pos].minTemp == \"Min TemperatureC\") or \\\n+                    (list_cur[pos].minTemp == \"\"):\n+                pos = pos + 1\n+            else:\n+                minT = list_cur[pos].minTemp\n+                print(year + \"       \" + list_cur[pos].date +\n+                      \"          \" + list_cur[pos].minTemp)\n+                break\n+\n+\n+# instructions for running the code file\n+def instructions():\n+    print \" \"\n+    print (\"Usage: weatherApp​ ​<report#>​ ​<data_dir>\")\n+    print \" \"\n+    print (\"[Report #]\")\n+    print (\"1 for Annual Max/Min Temperature\")\n+    print \"2 for Hottest day of each year\"\n+    print \"3 for coldest day of each year​\"\n+    print \" \"\n+    print \"[data_dir]\"\n+    print \"Path of Directory containing weather data files\"\n+    print \" \"\n+\n+# dictionary data struct for having list of data against year\n+# i-e [key:value]-> [year: listofusrecords]\n+my_dict = {}\n+# simple list of years to avoid hard coding of years\n+yearlist = []\n+\n+# argument list check\n+if len(sys.argv) != 3:","path":"weatherApp.py","position":156,"original_position":156,"commit_id":"9ff575c816d071b39cb808b756b7a919f8b053c8","original_commit_id":"9ff575c816d071b39cb808b756b7a919f8b053c8","user":{"login":"alisufian","id":4245598,"avatar_url":"https://avatars.githubusercontent.com/u/4245598?v=3","gravatar_id":"","url":"https://api.github.com/users/alisufian","html_url":"https://github.com/alisufian","followers_url":"https://api.github.com/users/alisufian/followers","following_url":"https://api.github.com/users/alisufian/following{/other_user}","gists_url":"https://api.github.com/users/alisufian/gists{/gist_id}","starred_url":"https://api.github.com/users/alisufian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alisufian/subscriptions","organizations_url":"https://api.github.com/users/alisufian/orgs","repos_url":"https://api.github.com/users/alisufian/repos","events_url":"https://api.github.com/users/alisufian/events{/privacy}","received_events_url":"https://api.github.com/users/alisufian/received_events","type":"User","site_admin":false},"body":"use argparse for commandline arguments parsing.","created_at":"2015-07-08T08:33:42Z","updated_at":"2015-07-08T08:33:42Z","html_url":"https://github.com/arbisoft/the-lab/pull/38#discussion_r34126069","pull_request_url":"https://api.github.com/repos/arbisoft/the-lab/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/arbisoft/the-lab/pulls/comments/34126069"},"html":{"href":"https://github.com/arbisoft/the-lab/pull/38#discussion_r34126069"},"pull_request":{"href":"https://api.github.com/repos/arbisoft/the-lab/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/arbisoft/the-lab/pulls/38","id":39353664,"html_url":"https://github.com/arbisoft/the-lab/pull/38","diff_url":"https://github.com/arbisoft/the-lab/pull/38.diff","patch_url":"https://github.com/arbisoft/the-lab/pull/38.patch","issue_url":"https://api.github.com/repos/arbisoft/the-lab/issues/38","number":38,"state":"open","locked":false,"title":"Assignment 1 version 1 regarding weatherdata","user":{"login":"mateen91","id":13199884,"avatar_url":"https://avatars.githubusercontent.com/u/13199884?v=3","gravatar_id":"","url":"https://api.github.com/users/mateen91","html_url":"https://github.com/mateen91","followers_url":"https://api.github.com/users/mateen91/followers","following_url":"https://api.github.com/users/mateen91/following{/other_user}","gists_url":"https://api.github.com/users/mateen91/gists{/gist_id}","starred_url":"https://api.github.com/users/mateen91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateen91/subscriptions","organizations_url":"https://api.github.com/users/mateen91/orgs","repos_url":"https://api.github.com/users/mateen91/repos","events_url":"https://api.github.com/users/mateen91/events{/privacy}","received_events_url":"https://api.github.com/users/mateen91/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-07T10:05:19Z","updated_at":"2015-07-08T08:33:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"474770081473a90bf9ee0982b56c9cb19c5efbd3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/arbisoft/the-lab/pulls/38/commits","review_comments_url":"https://api.github.com/repos/arbisoft/the-lab/pulls/38/comments","review_comment_url":"https://api.github.com/repos/arbisoft/the-lab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arbisoft/the-lab/issues/38/comments","statuses_url":"https://api.github.com/repos/arbisoft/the-lab/statuses/9ff575c816d071b39cb808b756b7a919f8b053c8","head":{"label":"arbisoft:mateenahmed-assignment1","ref":"mateenahmed-assignment1","sha":"9ff575c816d071b39cb808b756b7a919f8b053c8","user":{"login":"arbisoft","id":9364531,"avatar_url":"https://avatars.githubusercontent.com/u/9364531?v=3","gravatar_id":"","url":"https://api.github.com/users/arbisoft","html_url":"https://github.com/arbisoft","followers_url":"https://api.github.com/users/arbisoft/followers","following_url":"https://api.github.com/users/arbisoft/following{/other_user}","gists_url":"https://api.github.com/users/arbisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/arbisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arbisoft/subscriptions","organizations_url":"https://api.github.com/users/arbisoft/orgs","repos_url":"https://api.github.com/users/arbisoft/repos","events_url":"https://api.github.com/users/arbisoft/events{/privacy}","received_events_url":"https://api.github.com/users/arbisoft/received_events","type":"Organization","site_admin":false},"repo":{"id":28802912,"name":"the-lab","full_name":"arbisoft/the-lab","owner":{"login":"arbisoft","id":9364531,"avatar_url":"https://avatars.githubusercontent.com/u/9364531?v=3","gravatar_id":"","url":"https://api.github.com/users/arbisoft","html_url":"https://github.com/arbisoft","followers_url":"https://api.github.com/users/arbisoft/followers","following_url":"https://api.github.com/users/arbisoft/following{/other_user}","gists_url":"https://api.github.com/users/arbisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/arbisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arbisoft/subscriptions","organizations_url":"https://api.github.com/users/arbisoft/orgs","repos_url":"https://api.github.com/users/arbisoft/repos","events_url":"https://api.github.com/users/arbisoft/events{/privacy}","received_events_url":"https://api.github.com/users/arbisoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arbisoft/the-lab","description":"Code written by new hires.","fork":false,"url":"https://api.github.com/repos/arbisoft/the-lab","forks_url":"https://api.github.com/repos/arbisoft/the-lab/forks","keys_url":"https://api.github.com/repos/arbisoft/the-lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arbisoft/the-lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arbisoft/the-lab/teams","hooks_url":"https://api.github.com/repos/arbisoft/the-lab/hooks","issue_events_url":"https://api.github.com/repos/arbisoft/the-lab/issues/events{/number}","events_url":"https://api.github.com/repos/arbisoft/the-lab/events","assignees_url":"https://api.github.com/repos/arbisoft/the-lab/assignees{/user}","branches_url":"https://api.github.com/repos/arbisoft/the-lab/branches{/branch}","tags_url":"https://api.github.com/repos/arbisoft/the-lab/tags","blobs_url":"https://api.github.com/repos/arbisoft/the-lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arbisoft/the-lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arbisoft/the-lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/arbisoft/the-lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arbisoft/the-lab/statuses/{sha}","languages_url":"https://api.github.com/repos/arbisoft/the-lab/languages","stargazers_url":"https://api.github.com/repos/arbisoft/the-lab/stargazers","contributors_url":"https://api.github.com/repos/arbisoft/the-lab/contributors","subscribers_url":"https://api.github.com/repos/arbisoft/the-lab/subscribers","subscription_url":"https://api.github.com/repos/arbisoft/the-lab/subscription","commits_url":"https://api.github.com/repos/arbisoft/the-lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/arbisoft/the-lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/arbisoft/the-lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/arbisoft/the-lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/arbisoft/the-lab/contents/{+path}","compare_url":"https://api.github.com/repos/arbisoft/the-lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arbisoft/the-lab/merges","archive_url":"https://api.github.com/repos/arbisoft/the-lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arbisoft/the-lab/downloads","issues_url":"https://api.github.com/repos/arbisoft/the-lab/issues{/number}","pulls_url":"https://api.github.com/repos/arbisoft/the-lab/pulls{/number}","milestones_url":"https://api.github.com/repos/arbisoft/the-lab/milestones{/number}","notifications_url":"https://api.github.com/repos/arbisoft/the-lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arbisoft/the-lab/labels{/name}","releases_url":"https://api.github.com/repos/arbisoft/the-lab/releases{/id}","created_at":"2015-01-05T07:51:29Z","updated_at":"2015-04-02T12:40:48Z","pushed_at":"2015-07-07T12:07:35Z","git_url":"git://github.com/arbisoft/the-lab.git","ssh_url":"git@github.com:arbisoft/the-lab.git","clone_url":"https://github.com/arbisoft/the-lab.git","svn_url":"https://github.com/arbisoft/the-lab","homepage":null,"size":40835,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"arbisoft:mateenahmed-master","ref":"mateenahmed-master","sha":"01f882701408d217c296cd087269c6ebf99dc44b","user":{"login":"arbisoft","id":9364531,"avatar_url":"https://avatars.githubusercontent.com/u/9364531?v=3","gravatar_id":"","url":"https://api.github.com/users/arbisoft","html_url":"https://github.com/arbisoft","followers_url":"https://api.github.com/users/arbisoft/followers","following_url":"https://api.github.com/users/arbisoft/following{/other_user}","gists_url":"https://api.github.com/users/arbisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/arbisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arbisoft/subscriptions","organizations_url":"https://api.github.com/users/arbisoft/orgs","repos_url":"https://api.github.com/users/arbisoft/repos","events_url":"https://api.github.com/users/arbisoft/events{/privacy}","received_events_url":"https://api.github.com/users/arbisoft/received_events","type":"Organization","site_admin":false},"repo":{"id":28802912,"name":"the-lab","full_name":"arbisoft/the-lab","owner":{"login":"arbisoft","id":9364531,"avatar_url":"https://avatars.githubusercontent.com/u/9364531?v=3","gravatar_id":"","url":"https://api.github.com/users/arbisoft","html_url":"https://github.com/arbisoft","followers_url":"https://api.github.com/users/arbisoft/followers","following_url":"https://api.github.com/users/arbisoft/following{/other_user}","gists_url":"https://api.github.com/users/arbisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/arbisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arbisoft/subscriptions","organizations_url":"https://api.github.com/users/arbisoft/orgs","repos_url":"https://api.github.com/users/arbisoft/repos","events_url":"https://api.github.com/users/arbisoft/events{/privacy}","received_events_url":"https://api.github.com/users/arbisoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arbisoft/the-lab","description":"Code written by new hires.","fork":false,"url":"https://api.github.com/repos/arbisoft/the-lab","forks_url":"https://api.github.com/repos/arbisoft/the-lab/forks","keys_url":"https://api.github.com/repos/arbisoft/the-lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arbisoft/the-lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arbisoft/the-lab/teams","hooks_url":"https://api.github.com/repos/arbisoft/the-lab/hooks","issue_events_url":"https://api.github.com/repos/arbisoft/the-lab/issues/events{/number}","events_url":"https://api.github.com/repos/arbisoft/the-lab/events","assignees_url":"https://api.github.com/repos/arbisoft/the-lab/assignees{/user}","branches_url":"https://api.github.com/repos/arbisoft/the-lab/branches{/branch}","tags_url":"https://api.github.com/repos/arbisoft/the-lab/tags","blobs_url":"https://api.github.com/repos/arbisoft/the-lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arbisoft/the-lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arbisoft/the-lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/arbisoft/the-lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arbisoft/the-lab/statuses/{sha}","languages_url":"https://api.github.com/repos/arbisoft/the-lab/languages","stargazers_url":"https://api.github.com/repos/arbisoft/the-lab/stargazers","contributors_url":"https://api.github.com/repos/arbisoft/the-lab/contributors","subscribers_url":"https://api.github.com/repos/arbisoft/the-lab/subscribers","subscription_url":"https://api.github.com/repos/arbisoft/the-lab/subscription","commits_url":"https://api.github.com/repos/arbisoft/the-lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/arbisoft/the-lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/arbisoft/the-lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/arbisoft/the-lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/arbisoft/the-lab/contents/{+path}","compare_url":"https://api.github.com/repos/arbisoft/the-lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arbisoft/the-lab/merges","archive_url":"https://api.github.com/repos/arbisoft/the-lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arbisoft/the-lab/downloads","issues_url":"https://api.github.com/repos/arbisoft/the-lab/issues{/number}","pulls_url":"https://api.github.com/repos/arbisoft/the-lab/pulls{/number}","milestones_url":"https://api.github.com/repos/arbisoft/the-lab/milestones{/number}","notifications_url":"https://api.github.com/repos/arbisoft/the-lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arbisoft/the-lab/labels{/name}","releases_url":"https://api.github.com/repos/arbisoft/the-lab/releases{/id}","created_at":"2015-01-05T07:51:29Z","updated_at":"2015-04-02T12:40:48Z","pushed_at":"2015-07-07T12:07:35Z","git_url":"git://github.com/arbisoft/the-lab.git","ssh_url":"git@github.com:arbisoft/the-lab.git","clone_url":"https://github.com/arbisoft/the-lab.git","svn_url":"https://github.com/arbisoft/the-lab","homepage":null,"size":40835,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arbisoft/the-lab/pulls/38"},"html":{"href":"https://github.com/arbisoft/the-lab/pull/38"},"issue":{"href":"https://api.github.com/repos/arbisoft/the-lab/issues/38"},"comments":{"href":"https://api.github.com/repos/arbisoft/the-lab/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/arbisoft/the-lab/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/arbisoft/the-lab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arbisoft/the-lab/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/arbisoft/the-lab/statuses/9ff575c816d071b39cb808b756b7a919f8b053c8"}}}}