{"action":"created","comment":{"url":"https://api.github.com/repos/UW-Hydro/VIC/pulls/comments/73465141","id":73465141,"diff_hunk":"@@ -306,3 +313,513 @@ def check_multistream_classic(fnames):\n                     actual, expected, decimal=4,\n                     err_msg='Variable=%s, freq=%s, how=%s: '\n                             'failed comparison' % (key, freq, how))\n+\n+def tsplit(string, delimiters):\n+    '''Behaves like str.split but supports multiple delimiters.\n+    '''\n+\n+    delimiters = tuple(delimiters)\n+    stack = [string,]\n+\n+    for delimiter in delimiters:\n+        for i, substring in enumerate(stack):\n+            substack = substring.split(delimiter)\n+            stack.pop(i)\n+            for j, _substring in enumerate(substack):\n+                stack.insert(i+j, _substring)\n+\n+    return stack\n+\n+def read_snotel_swe_obs(filename, science_test_data_dir, items):\n+\n+    ''' reads in Snotel SWE obs and returns DataFrame\n+    '''\n+\n+    filename_fullpath = os.path.join(science_test_data_dir,\n+                                    'datasets',\n+                                    items['archive'],\n+                                    'observations',\n+                                    filename)\n+\n+    # load snotel obs\n+    snotel_swe = pd.read_csv(filename_fullpath,\n+                            skiprows=0,\n+                            delim_whitespace=True,\n+                            names=['YEAR', 'MONTH', 'DAY', 'OUT_SWE'])\n+\n+    # add datetime object column to snotel DataFrame\n+    snotel_swe['DATES'] = pd.to_datetime(snotel_swe.YEAR * 10000 +\n+                                        snotel_swe.MONTH * 100 +\n+                                        snotel_swe.DAY,\n+                                        format='%Y%m%d')\n+\n+    # remove year, month, day columns of DataFrame\n+    snotel_swe.drop(['YEAR', 'MONTH', 'DAY'], inplace=True, axis=1)\n+\n+    snotel_swe.index = snotel_swe['DATES']\n+\n+    return(snotel_swe)\n+\n+def read_vic_42_output(lat, lng, science_test_data_dir, items):\n+    ''' reads output from VIC 4.2\n+    '''\n+\n+    if 'ecflux' in items['compare_to']:\n+        vic_42_file = 'en_bal_%s_%s' % (lat, lng)\n+        vic_42_dir = os.path.join(science_test_data_dir, 'test_runs',\n+                                items['archive'], 'ecflux', 'results')\n+\n+    elif 'snotel' in items['compare_to']:\n+        vic_42_file = 'outfile_%s_%s' % (lat, lng)\n+        vic_42_dir = os.path.join(science_test_data_dir, 'test_runs',\n+                                items['archive'], 'snotel', 'results')","path":"tests/test_utils.py","position":112,"original_position":112,"commit_id":"79b1ef7e110373642abd0a4067a6cde56b4ffc23","original_commit_id":"79b1ef7e110373642abd0a4067a6cde56b4ffc23","user":{"login":"jhamman","id":2443309,"avatar_url":"https://avatars.githubusercontent.com/u/2443309?v=3","gravatar_id":"","url":"https://api.github.com/users/jhamman","html_url":"https://github.com/jhamman","followers_url":"https://api.github.com/users/jhamman/followers","following_url":"https://api.github.com/users/jhamman/following{/other_user}","gists_url":"https://api.github.com/users/jhamman/gists{/gist_id}","starred_url":"https://api.github.com/users/jhamman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhamman/subscriptions","organizations_url":"https://api.github.com/users/jhamman/orgs","repos_url":"https://api.github.com/users/jhamman/repos","events_url":"https://api.github.com/users/jhamman/events{/privacy}","received_events_url":"https://api.github.com/users/jhamman/received_events","type":"User","site_admin":false},"body":"indentation here and above.","created_at":"2016-08-04T05:47:00Z","updated_at":"2016-08-04T05:47:00Z","html_url":"https://github.com/UW-Hydro/VIC/pull/544#discussion_r73465141","pull_request_url":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544","_links":{"self":{"href":"https://api.github.com/repos/UW-Hydro/VIC/pulls/comments/73465141"},"html":{"href":"https://github.com/UW-Hydro/VIC/pull/544#discussion_r73465141"},"pull_request":{"href":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544"}}},"pull_request":{"url":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544","id":75727126,"html_url":"https://github.com/UW-Hydro/VIC/pull/544","diff_url":"https://github.com/UW-Hydro/VIC/pull/544.diff","patch_url":"https://github.com/UW-Hydro/VIC/pull/544.patch","issue_url":"https://api.github.com/repos/UW-Hydro/VIC/issues/544","number":544,"state":"open","locked":false,"title":"Feature/add science testing","user":{"login":"dgergel","id":5017308,"avatar_url":"https://avatars.githubusercontent.com/u/5017308?v=3","gravatar_id":"","url":"https://api.github.com/users/dgergel","html_url":"https://github.com/dgergel","followers_url":"https://api.github.com/users/dgergel/followers","following_url":"https://api.github.com/users/dgergel/following{/other_user}","gists_url":"https://api.github.com/users/dgergel/gists{/gist_id}","starred_url":"https://api.github.com/users/dgergel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgergel/subscriptions","organizations_url":"https://api.github.com/users/dgergel/orgs","repos_url":"https://api.github.com/users/dgergel/repos","events_url":"https://api.github.com/users/dgergel/events{/privacy}","received_events_url":"https://api.github.com/users/dgergel/received_events","type":"User","site_admin":false},"body":"This PR includes the following: \r\n\r\n1) adding point simulations with SnoTel and Ameriflux forcings for the VIC 5.0 testing infrastructure - compares current version of VIC 5 to previous versions (VIC 5.0 and VIC 4.2 - set up to compare future release candidates and versions with the initial VIC 5.0 release). SnoTel and Ameriflux simulations for VIC 4.2 and 5.0 are archived and for now are housed in the `VIC_test_data` Dropbox repo. This directory can be specified in `run_tests.py` with a new `arg.parser` optional argument (default is the `VIC_sample_data` directory). \r\n2) analysis plots to compare the point simulations. Includes 1) daily plots for SnoTel stations and 2) annual mean diurnal cycle and monthly mean diurnal cycle for Ameriflux sites\r\n\r\nChanges to the following files: \r\n\r\n- run_tests.py\r\n\r\n- test_utils.py - this now includes plotting functions for snotel and Ameriflux analysis as well as a string parsing function for getting lat/lon info from the Ameriflux site files \r\n\r\n- science.cfg \r\n\r\n- global_param.classic.4.2_snotel.txt\r\n\r\n- global_param.classic.5.0_snotel.txt\r\n\r\n- global_param.classic.4.2_ecflux.txt\r\n\r\n- global_param.classic.5.0_ecflux.txt","created_at":"2016-06-29T21:44:38Z","updated_at":"2016-08-04T05:47:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a0d30dae938867b2ee74b8f949041f069b3fbab","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544/commits","review_comments_url":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544/comments","review_comment_url":"https://api.github.com/repos/UW-Hydro/VIC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UW-Hydro/VIC/issues/544/comments","statuses_url":"https://api.github.com/repos/UW-Hydro/VIC/statuses/79b1ef7e110373642abd0a4067a6cde56b4ffc23","head":{"label":"dgergel:feature/add_science_testing","ref":"feature/add_science_testing","sha":"79b1ef7e110373642abd0a4067a6cde56b4ffc23","user":{"login":"dgergel","id":5017308,"avatar_url":"https://avatars.githubusercontent.com/u/5017308?v=3","gravatar_id":"","url":"https://api.github.com/users/dgergel","html_url":"https://github.com/dgergel","followers_url":"https://api.github.com/users/dgergel/followers","following_url":"https://api.github.com/users/dgergel/following{/other_user}","gists_url":"https://api.github.com/users/dgergel/gists{/gist_id}","starred_url":"https://api.github.com/users/dgergel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgergel/subscriptions","organizations_url":"https://api.github.com/users/dgergel/orgs","repos_url":"https://api.github.com/users/dgergel/repos","events_url":"https://api.github.com/users/dgergel/events{/privacy}","received_events_url":"https://api.github.com/users/dgergel/received_events","type":"User","site_admin":false},"repo":{"id":30215351,"name":"VIC","full_name":"dgergel/VIC","owner":{"login":"dgergel","id":5017308,"avatar_url":"https://avatars.githubusercontent.com/u/5017308?v=3","gravatar_id":"","url":"https://api.github.com/users/dgergel","html_url":"https://github.com/dgergel","followers_url":"https://api.github.com/users/dgergel/followers","following_url":"https://api.github.com/users/dgergel/following{/other_user}","gists_url":"https://api.github.com/users/dgergel/gists{/gist_id}","starred_url":"https://api.github.com/users/dgergel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgergel/subscriptions","organizations_url":"https://api.github.com/users/dgergel/orgs","repos_url":"https://api.github.com/users/dgergel/repos","events_url":"https://api.github.com/users/dgergel/events{/privacy}","received_events_url":"https://api.github.com/users/dgergel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgergel/VIC","description":"The Variable Infiltration Capacity (VIC) Macroscale Hydrologic Model","fork":true,"url":"https://api.github.com/repos/dgergel/VIC","forks_url":"https://api.github.com/repos/dgergel/VIC/forks","keys_url":"https://api.github.com/repos/dgergel/VIC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgergel/VIC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgergel/VIC/teams","hooks_url":"https://api.github.com/repos/dgergel/VIC/hooks","issue_events_url":"https://api.github.com/repos/dgergel/VIC/issues/events{/number}","events_url":"https://api.github.com/repos/dgergel/VIC/events","assignees_url":"https://api.github.com/repos/dgergel/VIC/assignees{/user}","branches_url":"https://api.github.com/repos/dgergel/VIC/branches{/branch}","tags_url":"https://api.github.com/repos/dgergel/VIC/tags","blobs_url":"https://api.github.com/repos/dgergel/VIC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgergel/VIC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgergel/VIC/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgergel/VIC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgergel/VIC/statuses/{sha}","languages_url":"https://api.github.com/repos/dgergel/VIC/languages","stargazers_url":"https://api.github.com/repos/dgergel/VIC/stargazers","contributors_url":"https://api.github.com/repos/dgergel/VIC/contributors","subscribers_url":"https://api.github.com/repos/dgergel/VIC/subscribers","subscription_url":"https://api.github.com/repos/dgergel/VIC/subscription","commits_url":"https://api.github.com/repos/dgergel/VIC/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgergel/VIC/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgergel/VIC/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgergel/VIC/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgergel/VIC/contents/{+path}","compare_url":"https://api.github.com/repos/dgergel/VIC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgergel/VIC/merges","archive_url":"https://api.github.com/repos/dgergel/VIC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgergel/VIC/downloads","issues_url":"https://api.github.com/repos/dgergel/VIC/issues{/number}","pulls_url":"https://api.github.com/repos/dgergel/VIC/pulls{/number}","milestones_url":"https://api.github.com/repos/dgergel/VIC/milestones{/number}","notifications_url":"https://api.github.com/repos/dgergel/VIC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgergel/VIC/labels{/name}","releases_url":"https://api.github.com/repos/dgergel/VIC/releases{/id}","deployments_url":"https://api.github.com/repos/dgergel/VIC/deployments","created_at":"2015-02-02T23:53:45Z","updated_at":"2016-03-24T20:15:28Z","pushed_at":"2016-08-03T23:25:11Z","git_url":"git://github.com/dgergel/VIC.git","ssh_url":"git@github.com:dgergel/VIC.git","clone_url":"https://github.com/dgergel/VIC.git","svn_url":"https://github.com/dgergel/VIC","homepage":"http://www.hydro.washington.edu/Lettenmaier/Models/VIC/index.shtml","size":15051,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"UW-Hydro:develop","ref":"develop","sha":"0601cfc7ab8de2d5d50dae1d09e22a1774f5216a","user":{"login":"UW-Hydro","id":3475662,"avatar_url":"https://avatars.githubusercontent.com/u/3475662?v=3","gravatar_id":"","url":"https://api.github.com/users/UW-Hydro","html_url":"https://github.com/UW-Hydro","followers_url":"https://api.github.com/users/UW-Hydro/followers","following_url":"https://api.github.com/users/UW-Hydro/following{/other_user}","gists_url":"https://api.github.com/users/UW-Hydro/gists{/gist_id}","starred_url":"https://api.github.com/users/UW-Hydro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UW-Hydro/subscriptions","organizations_url":"https://api.github.com/users/UW-Hydro/orgs","repos_url":"https://api.github.com/users/UW-Hydro/repos","events_url":"https://api.github.com/users/UW-Hydro/events{/privacy}","received_events_url":"https://api.github.com/users/UW-Hydro/received_events","type":"Organization","site_admin":false},"repo":{"id":8064928,"name":"VIC","full_name":"UW-Hydro/VIC","owner":{"login":"UW-Hydro","id":3475662,"avatar_url":"https://avatars.githubusercontent.com/u/3475662?v=3","gravatar_id":"","url":"https://api.github.com/users/UW-Hydro","html_url":"https://github.com/UW-Hydro","followers_url":"https://api.github.com/users/UW-Hydro/followers","following_url":"https://api.github.com/users/UW-Hydro/following{/other_user}","gists_url":"https://api.github.com/users/UW-Hydro/gists{/gist_id}","starred_url":"https://api.github.com/users/UW-Hydro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UW-Hydro/subscriptions","organizations_url":"https://api.github.com/users/UW-Hydro/orgs","repos_url":"https://api.github.com/users/UW-Hydro/repos","events_url":"https://api.github.com/users/UW-Hydro/events{/privacy}","received_events_url":"https://api.github.com/users/UW-Hydro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UW-Hydro/VIC","description":"The Variable Infiltration Capacity (VIC) Macroscale Hydrologic Model","fork":false,"url":"https://api.github.com/repos/UW-Hydro/VIC","forks_url":"https://api.github.com/repos/UW-Hydro/VIC/forks","keys_url":"https://api.github.com/repos/UW-Hydro/VIC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UW-Hydro/VIC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UW-Hydro/VIC/teams","hooks_url":"https://api.github.com/repos/UW-Hydro/VIC/hooks","issue_events_url":"https://api.github.com/repos/UW-Hydro/VIC/issues/events{/number}","events_url":"https://api.github.com/repos/UW-Hydro/VIC/events","assignees_url":"https://api.github.com/repos/UW-Hydro/VIC/assignees{/user}","branches_url":"https://api.github.com/repos/UW-Hydro/VIC/branches{/branch}","tags_url":"https://api.github.com/repos/UW-Hydro/VIC/tags","blobs_url":"https://api.github.com/repos/UW-Hydro/VIC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UW-Hydro/VIC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UW-Hydro/VIC/git/refs{/sha}","trees_url":"https://api.github.com/repos/UW-Hydro/VIC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UW-Hydro/VIC/statuses/{sha}","languages_url":"https://api.github.com/repos/UW-Hydro/VIC/languages","stargazers_url":"https://api.github.com/repos/UW-Hydro/VIC/stargazers","contributors_url":"https://api.github.com/repos/UW-Hydro/VIC/contributors","subscribers_url":"https://api.github.com/repos/UW-Hydro/VIC/subscribers","subscription_url":"https://api.github.com/repos/UW-Hydro/VIC/subscription","commits_url":"https://api.github.com/repos/UW-Hydro/VIC/commits{/sha}","git_commits_url":"https://api.github.com/repos/UW-Hydro/VIC/git/commits{/sha}","comments_url":"https://api.github.com/repos/UW-Hydro/VIC/comments{/number}","issue_comment_url":"https://api.github.com/repos/UW-Hydro/VIC/issues/comments{/number}","contents_url":"https://api.github.com/repos/UW-Hydro/VIC/contents/{+path}","compare_url":"https://api.github.com/repos/UW-Hydro/VIC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UW-Hydro/VIC/merges","archive_url":"https://api.github.com/repos/UW-Hydro/VIC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UW-Hydro/VIC/downloads","issues_url":"https://api.github.com/repos/UW-Hydro/VIC/issues{/number}","pulls_url":"https://api.github.com/repos/UW-Hydro/VIC/pulls{/number}","milestones_url":"https://api.github.com/repos/UW-Hydro/VIC/milestones{/number}","notifications_url":"https://api.github.com/repos/UW-Hydro/VIC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UW-Hydro/VIC/labels{/name}","releases_url":"https://api.github.com/repos/UW-Hydro/VIC/releases{/id}","deployments_url":"https://api.github.com/repos/UW-Hydro/VIC/deployments","created_at":"2013-02-07T02:30:14Z","updated_at":"2016-08-03T18:28:50Z","pushed_at":"2016-08-04T00:58:28Z","git_url":"git://github.com/UW-Hydro/VIC.git","ssh_url":"git@github.com:UW-Hydro/VIC.git","clone_url":"https://github.com/UW-Hydro/VIC.git","svn_url":"https://github.com/UW-Hydro/VIC","homepage":"http://vic.readthedocs.io","size":23037,"stargazers_count":32,"watchers_count":32,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"open_issues_count":73,"forks":114,"open_issues":73,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544"},"html":{"href":"https://github.com/UW-Hydro/VIC/pull/544"},"issue":{"href":"https://api.github.com/repos/UW-Hydro/VIC/issues/544"},"comments":{"href":"https://api.github.com/repos/UW-Hydro/VIC/issues/544/comments"},"review_comments":{"href":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544/comments"},"review_comment":{"href":"https://api.github.com/repos/UW-Hydro/VIC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UW-Hydro/VIC/pulls/544/commits"},"statuses":{"href":"https://api.github.com/repos/UW-Hydro/VIC/statuses/79b1ef7e110373642abd0a4067a6cde56b4ffc23"}}}}
{"actor":{"display_login":"jhamman"}}