{"action":"created","comment":{"url":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/comments/53847894","id":53847894,"diff_hunk":"@@ -52,4 +60,49 @@ test_that(\"may load has a reasonable range of values\", {\n test_that(\"may loads for the MISS site are included\", {\n \tmiss_sites <- subset(mloads, SITE_ABB == 'MISS')\n \texpect_gt(nrow(miss_sites), 0)\n-})\n\\ No newline at end of file\n+})\n+\n+\n+\n+test_that(\"may loads are less than corresponding annual loads for a given site/water year/constituent\", {\n+ #an earlier option using match is to merge the aloads and temp_mloads data frame is commented out for now.\n+   #temp_mloads$aloads<-as.numeric(aloads[match(paste(temp_mloads$SITE_ABB,temp_mloads$WY,temp_mloads$CONSTIT,sep=\"_\"),paste(aloads$SITE_ABB,aloads$WY,aloads$CONSTIT,sep=\"_\")),\"TONS\"])\n+   tt<-left_join(temp_mloads, aloads, by = c(\"SITE_ABB\" = \"SITE_ABB\", \"WY\" = \"WY\",\"CONSTIT\"=\"CONSTIT\"))\n+     result <- validate::check_that(tt, \n+                                 TONS_N < as.numeric(TONS.y)\n+                             \n+                                 \n+                                 )\n+  \n+     \n+     expect_no_errors(result)\n+})\n+\n+\n+\n+\n+test_that(\"Most recent water year has all of the necessary sites \", {\n+  result <- validate::check_that(temp_mloads_recent, \n+                                 sort(unique(SITE_ABB)) == sort(c(\"HAZL\",\"PADU\",\"GRAN\",\"HAST\",\"CLIN\",\"WAPE\",\"KEOS\",\"VALL\",\"GRAF\",\"SIDN\",\"OMAH\",\"ELKH\",\"LOUI\",\"DESO\",\"HERM\",\"THEB\",\"SEDG\",\"HARR\",\"LITT\",\"LONG\",\n+                                                                  \"STFR\",\"BATO\",\"BELL\",\"MELV\",\"CALU\",\"MORG\",\"VICK\",\"SEWI\",\"SUMN\",\"STTH\",\"ALEX\",\"GULF\",\"NEWH\",\"CANN\",\"MISS\"))\n+                                 \n+  )\n+  \n+  expect_no_errors(result)\n+\n+  })\n+\n+\n+\n+test_that(\"Load data have the correct number of significant digits\", {\n+  result <- validate::check_that(temp_mloads, \n+                                 \n+                                 nchar(sub(\"^[0]+\", \"\",sub(\"[.]\",\"\",temp_mloads$TONS_N/1E5)))<=3,\n+                                 nchar(sub(\"^[0]+\", \"\",sub(\"[.]\",\"\",temp_mloads$TONS_L95_N/1E5)))<=3,\n+                                 nchar(sub(\"^[0]+\", \"\",sub(\"[.]\",\"\",temp_mloads$TONS_U95_N/1E5)))<=3\n+                                 \n+                                 )\n+  ","path":"tests/testthat/test_may_load.R","position":98,"original_position":98,"commit_id":"18893d83cb99a714dce5569785fea6d95099990e","original_commit_id":"18893d83cb99a714dce5569785fea6d95099990e","user":{"login":"cschroed-usgs","id":3419837,"avatar_url":"https://avatars.githubusercontent.com/u/3419837?v=3","gravatar_id":"","url":"https://api.github.com/users/cschroed-usgs","html_url":"https://github.com/cschroed-usgs","followers_url":"https://api.github.com/users/cschroed-usgs/followers","following_url":"https://api.github.com/users/cschroed-usgs/following{/other_user}","gists_url":"https://api.github.com/users/cschroed-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/cschroed-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cschroed-usgs/subscriptions","organizations_url":"https://api.github.com/users/cschroed-usgs/orgs","repos_url":"https://api.github.com/users/cschroed-usgs/repos","events_url":"https://api.github.com/users/cschroed-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/cschroed-usgs/received_events","type":"User","site_admin":false},"body":"Please add a call to `expect_no_errors` here.","created_at":"2016-02-23T20:52:28Z","updated_at":"2016-02-23T20:52:28Z","html_url":"https://github.com/USGS-CIDA/nar_data/pull/27#discussion_r53847894","pull_request_url":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/comments/53847894"},"html":{"href":"https://github.com/USGS-CIDA/nar_data/pull/27#discussion_r53847894"},"pull_request":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27","id":60011229,"html_url":"https://github.com/USGS-CIDA/nar_data/pull/27","diff_url":"https://github.com/USGS-CIDA/nar_data/pull/27.diff","patch_url":"https://github.com/USGS-CIDA/nar_data/pull/27.patch","issue_url":"https://api.github.com/repos/USGS-CIDA/nar_data/issues/27","number":27,"state":"open","locked":false,"title":"More tests and changes of data from numeric to character","user":{"login":"supercasey","id":3651871,"avatar_url":"https://avatars.githubusercontent.com/u/3651871?v=3","gravatar_id":"","url":"https://api.github.com/users/supercasey","html_url":"https://github.com/supercasey","followers_url":"https://api.github.com/users/supercasey/followers","following_url":"https://api.github.com/users/supercasey/following{/other_user}","gists_url":"https://api.github.com/users/supercasey/gists{/gist_id}","starred_url":"https://api.github.com/users/supercasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supercasey/subscriptions","organizations_url":"https://api.github.com/users/supercasey/orgs","repos_url":"https://api.github.com/users/supercasey/repos","events_url":"https://api.github.com/users/supercasey/events{/privacy}","received_events_url":"https://api.github.com/users/supercasey/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-19T21:39:13Z","updated_at":"2016-02-23T20:52:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"478a5802a11c8497008be03a2b560d4f2cf383f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27/commits","review_comments_url":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27/comments","review_comment_url":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/USGS-CIDA/nar_data/issues/27/comments","statuses_url":"https://api.github.com/repos/USGS-CIDA/nar_data/statuses/18893d83cb99a714dce5569785fea6d95099990e","head":{"label":"supercasey:master","ref":"master","sha":"18893d83cb99a714dce5569785fea6d95099990e","user":{"login":"supercasey","id":3651871,"avatar_url":"https://avatars.githubusercontent.com/u/3651871?v=3","gravatar_id":"","url":"https://api.github.com/users/supercasey","html_url":"https://github.com/supercasey","followers_url":"https://api.github.com/users/supercasey/followers","following_url":"https://api.github.com/users/supercasey/following{/other_user}","gists_url":"https://api.github.com/users/supercasey/gists{/gist_id}","starred_url":"https://api.github.com/users/supercasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supercasey/subscriptions","organizations_url":"https://api.github.com/users/supercasey/orgs","repos_url":"https://api.github.com/users/supercasey/repos","events_url":"https://api.github.com/users/supercasey/events{/privacy}","received_events_url":"https://api.github.com/users/supercasey/received_events","type":"User","site_admin":false},"repo":{"id":49076715,"name":"nar_data","full_name":"supercasey/nar_data","owner":{"login":"supercasey","id":3651871,"avatar_url":"https://avatars.githubusercontent.com/u/3651871?v=3","gravatar_id":"","url":"https://api.github.com/users/supercasey","html_url":"https://github.com/supercasey","followers_url":"https://api.github.com/users/supercasey/followers","following_url":"https://api.github.com/users/supercasey/following{/other_user}","gists_url":"https://api.github.com/users/supercasey/gists{/gist_id}","starred_url":"https://api.github.com/users/supercasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supercasey/subscriptions","organizations_url":"https://api.github.com/users/supercasey/orgs","repos_url":"https://api.github.com/users/supercasey/repos","events_url":"https://api.github.com/users/supercasey/events{/privacy}","received_events_url":"https://api.github.com/users/supercasey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/supercasey/nar_data","description":"Data for the NAWQA Annual Reporting application","fork":true,"url":"https://api.github.com/repos/supercasey/nar_data","forks_url":"https://api.github.com/repos/supercasey/nar_data/forks","keys_url":"https://api.github.com/repos/supercasey/nar_data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/supercasey/nar_data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/supercasey/nar_data/teams","hooks_url":"https://api.github.com/repos/supercasey/nar_data/hooks","issue_events_url":"https://api.github.com/repos/supercasey/nar_data/issues/events{/number}","events_url":"https://api.github.com/repos/supercasey/nar_data/events","assignees_url":"https://api.github.com/repos/supercasey/nar_data/assignees{/user}","branches_url":"https://api.github.com/repos/supercasey/nar_data/branches{/branch}","tags_url":"https://api.github.com/repos/supercasey/nar_data/tags","blobs_url":"https://api.github.com/repos/supercasey/nar_data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/supercasey/nar_data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/supercasey/nar_data/git/refs{/sha}","trees_url":"https://api.github.com/repos/supercasey/nar_data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/supercasey/nar_data/statuses/{sha}","languages_url":"https://api.github.com/repos/supercasey/nar_data/languages","stargazers_url":"https://api.github.com/repos/supercasey/nar_data/stargazers","contributors_url":"https://api.github.com/repos/supercasey/nar_data/contributors","subscribers_url":"https://api.github.com/repos/supercasey/nar_data/subscribers","subscription_url":"https://api.github.com/repos/supercasey/nar_data/subscription","commits_url":"https://api.github.com/repos/supercasey/nar_data/commits{/sha}","git_commits_url":"https://api.github.com/repos/supercasey/nar_data/git/commits{/sha}","comments_url":"https://api.github.com/repos/supercasey/nar_data/comments{/number}","issue_comment_url":"https://api.github.com/repos/supercasey/nar_data/issues/comments{/number}","contents_url":"https://api.github.com/repos/supercasey/nar_data/contents/{+path}","compare_url":"https://api.github.com/repos/supercasey/nar_data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/supercasey/nar_data/merges","archive_url":"https://api.github.com/repos/supercasey/nar_data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/supercasey/nar_data/downloads","issues_url":"https://api.github.com/repos/supercasey/nar_data/issues{/number}","pulls_url":"https://api.github.com/repos/supercasey/nar_data/pulls{/number}","milestones_url":"https://api.github.com/repos/supercasey/nar_data/milestones{/number}","notifications_url":"https://api.github.com/repos/supercasey/nar_data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/supercasey/nar_data/labels{/name}","releases_url":"https://api.github.com/repos/supercasey/nar_data/releases{/id}","deployments_url":"https://api.github.com/repos/supercasey/nar_data/deployments","created_at":"2016-01-05T16:06:49Z","updated_at":"2016-01-11T15:58:03Z","pushed_at":"2016-02-22T16:12:42Z","git_url":"git://github.com/supercasey/nar_data.git","ssh_url":"git@github.com:supercasey/nar_data.git","clone_url":"https://github.com/supercasey/nar_data.git","svn_url":"https://github.com/supercasey/nar_data","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"USGS-CIDA:master","ref":"master","sha":"341ee10005ecac8b57e3c4fc391fa078d45ab80d","user":{"login":"USGS-CIDA","id":918179,"avatar_url":"https://avatars.githubusercontent.com/u/918179?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-CIDA","html_url":"https://github.com/USGS-CIDA","followers_url":"https://api.github.com/users/USGS-CIDA/followers","following_url":"https://api.github.com/users/USGS-CIDA/following{/other_user}","gists_url":"https://api.github.com/users/USGS-CIDA/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-CIDA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-CIDA/subscriptions","organizations_url":"https://api.github.com/users/USGS-CIDA/orgs","repos_url":"https://api.github.com/users/USGS-CIDA/repos","events_url":"https://api.github.com/users/USGS-CIDA/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-CIDA/received_events","type":"Organization","site_admin":false},"repo":{"id":48390156,"name":"nar_data","full_name":"USGS-CIDA/nar_data","owner":{"login":"USGS-CIDA","id":918179,"avatar_url":"https://avatars.githubusercontent.com/u/918179?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-CIDA","html_url":"https://github.com/USGS-CIDA","followers_url":"https://api.github.com/users/USGS-CIDA/followers","following_url":"https://api.github.com/users/USGS-CIDA/following{/other_user}","gists_url":"https://api.github.com/users/USGS-CIDA/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-CIDA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-CIDA/subscriptions","organizations_url":"https://api.github.com/users/USGS-CIDA/orgs","repos_url":"https://api.github.com/users/USGS-CIDA/repos","events_url":"https://api.github.com/users/USGS-CIDA/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-CIDA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/USGS-CIDA/nar_data","description":"Data for the NAWQA Annual Reporting application","fork":false,"url":"https://api.github.com/repos/USGS-CIDA/nar_data","forks_url":"https://api.github.com/repos/USGS-CIDA/nar_data/forks","keys_url":"https://api.github.com/repos/USGS-CIDA/nar_data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/USGS-CIDA/nar_data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/USGS-CIDA/nar_data/teams","hooks_url":"https://api.github.com/repos/USGS-CIDA/nar_data/hooks","issue_events_url":"https://api.github.com/repos/USGS-CIDA/nar_data/issues/events{/number}","events_url":"https://api.github.com/repos/USGS-CIDA/nar_data/events","assignees_url":"https://api.github.com/repos/USGS-CIDA/nar_data/assignees{/user}","branches_url":"https://api.github.com/repos/USGS-CIDA/nar_data/branches{/branch}","tags_url":"https://api.github.com/repos/USGS-CIDA/nar_data/tags","blobs_url":"https://api.github.com/repos/USGS-CIDA/nar_data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/USGS-CIDA/nar_data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/USGS-CIDA/nar_data/git/refs{/sha}","trees_url":"https://api.github.com/repos/USGS-CIDA/nar_data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/USGS-CIDA/nar_data/statuses/{sha}","languages_url":"https://api.github.com/repos/USGS-CIDA/nar_data/languages","stargazers_url":"https://api.github.com/repos/USGS-CIDA/nar_data/stargazers","contributors_url":"https://api.github.com/repos/USGS-CIDA/nar_data/contributors","subscribers_url":"https://api.github.com/repos/USGS-CIDA/nar_data/subscribers","subscription_url":"https://api.github.com/repos/USGS-CIDA/nar_data/subscription","commits_url":"https://api.github.com/repos/USGS-CIDA/nar_data/commits{/sha}","git_commits_url":"https://api.github.com/repos/USGS-CIDA/nar_data/git/commits{/sha}","comments_url":"https://api.github.com/repos/USGS-CIDA/nar_data/comments{/number}","issue_comment_url":"https://api.github.com/repos/USGS-CIDA/nar_data/issues/comments{/number}","contents_url":"https://api.github.com/repos/USGS-CIDA/nar_data/contents/{+path}","compare_url":"https://api.github.com/repos/USGS-CIDA/nar_data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/USGS-CIDA/nar_data/merges","archive_url":"https://api.github.com/repos/USGS-CIDA/nar_data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/USGS-CIDA/nar_data/downloads","issues_url":"https://api.github.com/repos/USGS-CIDA/nar_data/issues{/number}","pulls_url":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls{/number}","milestones_url":"https://api.github.com/repos/USGS-CIDA/nar_data/milestones{/number}","notifications_url":"https://api.github.com/repos/USGS-CIDA/nar_data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/USGS-CIDA/nar_data/labels{/name}","releases_url":"https://api.github.com/repos/USGS-CIDA/nar_data/releases{/id}","deployments_url":"https://api.github.com/repos/USGS-CIDA/nar_data/deployments","created_at":"2015-12-21T19:31:22Z","updated_at":"2016-01-12T17:18:14Z","pushed_at":"2016-02-22T16:12:42Z","git_url":"git://github.com/USGS-CIDA/nar_data.git","ssh_url":"git@github.com:USGS-CIDA/nar_data.git","clone_url":"https://github.com/USGS-CIDA/nar_data.git","svn_url":"https://github.com/USGS-CIDA/nar_data","homepage":null,"size":74,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27"},"html":{"href":"https://github.com/USGS-CIDA/nar_data/pull/27"},"issue":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/issues/27"},"comments":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/USGS-CIDA/nar_data/statuses/18893d83cb99a714dce5569785fea6d95099990e"}}}}