{"action":"created","comment":{"url":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/comments/28681116","id":28681116,"diff_hunk":"@@ -73,3 +66,136 @@ def test_pearson_conf():\n     rl, ru = met.pearson_conf(r, n, c=95)\n     nptest.assert_almost_equal(rl, np.array([0.406, 0.784]), decimal=3)\n     nptest.assert_almost_equal(ru, np.array([0.812, 0.857]), decimal=3)\n+\n+\n+def test_bias():\n+    \"\"\"\n+    Test for bias\n+    \"\"\"\n+    # example 1\n+    x = np.arange(10)\n+    y = np.arange(10) + 2\n+\n+    b_pred = -2\n+    b_obs = met.bias(x, y)\n+\n+    nptest.assert_equal(b_obs, b_pred)\n+\n+    # example 2\n+    x = np.arange(10)\n+    y = np.arange(20, 30)\n+\n+    b_pred = 20\n+    b_obs = met.bias(y, x)\n+\n+    nptest.assert_equal(b_obs, b_pred)\n+\n+\n+def test_aad():\n+    \"\"\"\n+    Test for average absolute deviation\n+    \"\"\"\n+    # example 1\n+    x = np.arange(10)\n+    y = np.arange(10) + 2\n+    dev_pred = 2\n+    dev_obs = met.aad(x, y)\n+\n+    nptest.assert_equal(dev_obs, dev_pred)\n+\n+    # example 2, with outlier\n+    x = np.arange(10)\n+    y = np.arange(10) + 2\n+    y[-1] = 201\n+    dev_pred = 21\n+    dev_obs = met.aad(x, y)\n+\n+    nptest.assert_equal(dev_obs, dev_pred)\n+\n+\n+def test_mad():\n+    \"\"\"\n+    Test for median absolute deviation\n+    \"\"\"\n+    # example 1\n+    x = np.arange(10)\n+    y = np.arange(10) + 2\n+    dev_pred = 2\n+    dev_obs = met.mad(x, y)\n+\n+    nptest.assert_equal(dev_obs, dev_pred)\n+\n+    # example 2, with outlier\n+    x = np.arange(10)\n+    y = np.arange(10) + 2\n+    y[-1] = 201\n+    dev_pred = 2\n+    dev_obs = met.mad(x, y)\n+\n+    nptest.assert_equal(dev_obs, dev_pred)\n+\n+\n+def test_rmsd():\n+    \"\"\"\n+    Test for rmsd\n+    \"\"\"\n+    # example 1\n+    x = np.arange(10)\n+    y = np.arange(10) + 2\n+\n+    rmsd_pred = 2\n+    rmsd_obs = met.rmsd(x, y)\n+\n+    nptest.assert_equal(rmsd_obs, rmsd_pred)\n+\n+    # example 2, with outlier\n+    x = np.arange(10)\n+    y = np.arange(10) + 2\n+    y[-1] = 100\n+\n+    rmsd_pred = np.sqrt(831)","path":"tests/test_metrics.py","position":132,"original_position":132,"commit_id":"e64b1f46844755b2067df665be1a078e4c65516d","original_commit_id":"e64b1f46844755b2067df665be1a078e4c65516d","user":{"login":"cpaulik","id":380927,"avatar_url":"https://avatars.githubusercontent.com/u/380927?v=3","gravatar_id":"","url":"https://api.github.com/users/cpaulik","html_url":"https://github.com/cpaulik","followers_url":"https://api.github.com/users/cpaulik/followers","following_url":"https://api.github.com/users/cpaulik/following{/other_user}","gists_url":"https://api.github.com/users/cpaulik/gists{/gist_id}","starred_url":"https://api.github.com/users/cpaulik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpaulik/subscriptions","organizations_url":"https://api.github.com/users/cpaulik/orgs","repos_url":"https://api.github.com/users/cpaulik/repos","events_url":"https://api.github.com/users/cpaulik/events{/privacy}","received_events_url":"https://api.github.com/users/cpaulik/received_events","type":"User","site_admin":false},"body":"This is not correct since the RSS is 8317 which divided by 10 should not be 831. But standard python2 division is of course dangerous and makes this work","created_at":"2015-04-20T11:29:57Z","updated_at":"2015-04-20T11:29:57Z","html_url":"https://github.com/TUW-GEO/pytesmo/pull/35#discussion_r28681116","pull_request_url":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/comments/28681116"},"html":{"href":"https://github.com/TUW-GEO/pytesmo/pull/35#discussion_r28681116"},"pull_request":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35","id":32491456,"html_url":"https://github.com/TUW-GEO/pytesmo/pull/35","diff_url":"https://github.com/TUW-GEO/pytesmo/pull/35.diff","patch_url":"https://github.com/TUW-GEO/pytesmo/pull/35.patch","issue_url":"https://api.github.com/repos/TUW-GEO/pytesmo/issues/35","number":35,"state":"open","locked":false,"title":"Added new metric mean absolute error","user":{"login":"sebhahn","id":5929935,"avatar_url":"https://avatars.githubusercontent.com/u/5929935?v=3","gravatar_id":"","url":"https://api.github.com/users/sebhahn","html_url":"https://github.com/sebhahn","followers_url":"https://api.github.com/users/sebhahn/followers","following_url":"https://api.github.com/users/sebhahn/following{/other_user}","gists_url":"https://api.github.com/users/sebhahn/gists{/gist_id}","starred_url":"https://api.github.com/users/sebhahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebhahn/subscriptions","organizations_url":"https://api.github.com/users/sebhahn/orgs","repos_url":"https://api.github.com/users/sebhahn/repos","events_url":"https://api.github.com/users/sebhahn/events{/privacy}","received_events_url":"https://api.github.com/users/sebhahn/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-02T08:23:13Z","updated_at":"2015-04-20T11:29:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4478c5b605c357cd2c80fe5d4eec7489987524ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35/commits","review_comments_url":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35/comments","review_comment_url":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TUW-GEO/pytesmo/issues/35/comments","statuses_url":"https://api.github.com/repos/TUW-GEO/pytesmo/statuses/e64b1f46844755b2067df665be1a078e4c65516d","head":{"label":"sebhahn:new-metric-mae","ref":"new-metric-mae","sha":"e64b1f46844755b2067df665be1a078e4c65516d","user":{"login":"sebhahn","id":5929935,"avatar_url":"https://avatars.githubusercontent.com/u/5929935?v=3","gravatar_id":"","url":"https://api.github.com/users/sebhahn","html_url":"https://github.com/sebhahn","followers_url":"https://api.github.com/users/sebhahn/followers","following_url":"https://api.github.com/users/sebhahn/following{/other_user}","gists_url":"https://api.github.com/users/sebhahn/gists{/gist_id}","starred_url":"https://api.github.com/users/sebhahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebhahn/subscriptions","organizations_url":"https://api.github.com/users/sebhahn/orgs","repos_url":"https://api.github.com/users/sebhahn/repos","events_url":"https://api.github.com/users/sebhahn/events{/privacy}","received_events_url":"https://api.github.com/users/sebhahn/received_events","type":"User","site_admin":false},"repo":{"id":14365748,"name":"pytesmo","full_name":"sebhahn/pytesmo","owner":{"login":"sebhahn","id":5929935,"avatar_url":"https://avatars.githubusercontent.com/u/5929935?v=3","gravatar_id":"","url":"https://api.github.com/users/sebhahn","html_url":"https://github.com/sebhahn","followers_url":"https://api.github.com/users/sebhahn/followers","following_url":"https://api.github.com/users/sebhahn/following{/other_user}","gists_url":"https://api.github.com/users/sebhahn/gists{/gist_id}","starred_url":"https://api.github.com/users/sebhahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebhahn/subscriptions","organizations_url":"https://api.github.com/users/sebhahn/orgs","repos_url":"https://api.github.com/users/sebhahn/repos","events_url":"https://api.github.com/users/sebhahn/events{/privacy}","received_events_url":"https://api.github.com/users/sebhahn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebhahn/pytesmo","description":"python Toolbox for the Evaluation of Soil Moisture Observations","fork":true,"url":"https://api.github.com/repos/sebhahn/pytesmo","forks_url":"https://api.github.com/repos/sebhahn/pytesmo/forks","keys_url":"https://api.github.com/repos/sebhahn/pytesmo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebhahn/pytesmo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebhahn/pytesmo/teams","hooks_url":"https://api.github.com/repos/sebhahn/pytesmo/hooks","issue_events_url":"https://api.github.com/repos/sebhahn/pytesmo/issues/events{/number}","events_url":"https://api.github.com/repos/sebhahn/pytesmo/events","assignees_url":"https://api.github.com/repos/sebhahn/pytesmo/assignees{/user}","branches_url":"https://api.github.com/repos/sebhahn/pytesmo/branches{/branch}","tags_url":"https://api.github.com/repos/sebhahn/pytesmo/tags","blobs_url":"https://api.github.com/repos/sebhahn/pytesmo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebhahn/pytesmo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebhahn/pytesmo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebhahn/pytesmo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebhahn/pytesmo/statuses/{sha}","languages_url":"https://api.github.com/repos/sebhahn/pytesmo/languages","stargazers_url":"https://api.github.com/repos/sebhahn/pytesmo/stargazers","contributors_url":"https://api.github.com/repos/sebhahn/pytesmo/contributors","subscribers_url":"https://api.github.com/repos/sebhahn/pytesmo/subscribers","subscription_url":"https://api.github.com/repos/sebhahn/pytesmo/subscription","commits_url":"https://api.github.com/repos/sebhahn/pytesmo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebhahn/pytesmo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebhahn/pytesmo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebhahn/pytesmo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebhahn/pytesmo/contents/{+path}","compare_url":"https://api.github.com/repos/sebhahn/pytesmo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebhahn/pytesmo/merges","archive_url":"https://api.github.com/repos/sebhahn/pytesmo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebhahn/pytesmo/downloads","issues_url":"https://api.github.com/repos/sebhahn/pytesmo/issues{/number}","pulls_url":"https://api.github.com/repos/sebhahn/pytesmo/pulls{/number}","milestones_url":"https://api.github.com/repos/sebhahn/pytesmo/milestones{/number}","notifications_url":"https://api.github.com/repos/sebhahn/pytesmo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebhahn/pytesmo/labels{/name}","releases_url":"https://api.github.com/repos/sebhahn/pytesmo/releases{/id}","created_at":"2013-11-13T14:10:39Z","updated_at":"2015-03-30T12:03:14Z","pushed_at":"2015-04-20T11:01:43Z","git_url":"git://github.com/sebhahn/pytesmo.git","ssh_url":"git@github.com:sebhahn/pytesmo.git","clone_url":"https://github.com/sebhahn/pytesmo.git","svn_url":"https://github.com/sebhahn/pytesmo","homepage":"http://rs.geo.tuwien.ac.at/validation_tool/pytesmo/","size":23719,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"TUW-GEO:develop","ref":"develop","sha":"cbbb72b3472f5caca1f60330e4e3cce156829249","user":{"login":"TUW-GEO","id":5213740,"avatar_url":"https://avatars.githubusercontent.com/u/5213740?v=3","gravatar_id":"","url":"https://api.github.com/users/TUW-GEO","html_url":"https://github.com/TUW-GEO","followers_url":"https://api.github.com/users/TUW-GEO/followers","following_url":"https://api.github.com/users/TUW-GEO/following{/other_user}","gists_url":"https://api.github.com/users/TUW-GEO/gists{/gist_id}","starred_url":"https://api.github.com/users/TUW-GEO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TUW-GEO/subscriptions","organizations_url":"https://api.github.com/users/TUW-GEO/orgs","repos_url":"https://api.github.com/users/TUW-GEO/repos","events_url":"https://api.github.com/users/TUW-GEO/events{/privacy}","received_events_url":"https://api.github.com/users/TUW-GEO/received_events","type":"Organization","site_admin":false},"repo":{"id":12056383,"name":"pytesmo","full_name":"TUW-GEO/pytesmo","owner":{"login":"TUW-GEO","id":5213740,"avatar_url":"https://avatars.githubusercontent.com/u/5213740?v=3","gravatar_id":"","url":"https://api.github.com/users/TUW-GEO","html_url":"https://github.com/TUW-GEO","followers_url":"https://api.github.com/users/TUW-GEO/followers","following_url":"https://api.github.com/users/TUW-GEO/following{/other_user}","gists_url":"https://api.github.com/users/TUW-GEO/gists{/gist_id}","starred_url":"https://api.github.com/users/TUW-GEO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TUW-GEO/subscriptions","organizations_url":"https://api.github.com/users/TUW-GEO/orgs","repos_url":"https://api.github.com/users/TUW-GEO/repos","events_url":"https://api.github.com/users/TUW-GEO/events{/privacy}","received_events_url":"https://api.github.com/users/TUW-GEO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TUW-GEO/pytesmo","description":"python Toolbox for the Evaluation of Soil Moisture Observations","fork":false,"url":"https://api.github.com/repos/TUW-GEO/pytesmo","forks_url":"https://api.github.com/repos/TUW-GEO/pytesmo/forks","keys_url":"https://api.github.com/repos/TUW-GEO/pytesmo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TUW-GEO/pytesmo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TUW-GEO/pytesmo/teams","hooks_url":"https://api.github.com/repos/TUW-GEO/pytesmo/hooks","issue_events_url":"https://api.github.com/repos/TUW-GEO/pytesmo/issues/events{/number}","events_url":"https://api.github.com/repos/TUW-GEO/pytesmo/events","assignees_url":"https://api.github.com/repos/TUW-GEO/pytesmo/assignees{/user}","branches_url":"https://api.github.com/repos/TUW-GEO/pytesmo/branches{/branch}","tags_url":"https://api.github.com/repos/TUW-GEO/pytesmo/tags","blobs_url":"https://api.github.com/repos/TUW-GEO/pytesmo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TUW-GEO/pytesmo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TUW-GEO/pytesmo/git/refs{/sha}","trees_url":"https://api.github.com/repos/TUW-GEO/pytesmo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TUW-GEO/pytesmo/statuses/{sha}","languages_url":"https://api.github.com/repos/TUW-GEO/pytesmo/languages","stargazers_url":"https://api.github.com/repos/TUW-GEO/pytesmo/stargazers","contributors_url":"https://api.github.com/repos/TUW-GEO/pytesmo/contributors","subscribers_url":"https://api.github.com/repos/TUW-GEO/pytesmo/subscribers","subscription_url":"https://api.github.com/repos/TUW-GEO/pytesmo/subscription","commits_url":"https://api.github.com/repos/TUW-GEO/pytesmo/commits{/sha}","git_commits_url":"https://api.github.com/repos/TUW-GEO/pytesmo/git/commits{/sha}","comments_url":"https://api.github.com/repos/TUW-GEO/pytesmo/comments{/number}","issue_comment_url":"https://api.github.com/repos/TUW-GEO/pytesmo/issues/comments{/number}","contents_url":"https://api.github.com/repos/TUW-GEO/pytesmo/contents/{+path}","compare_url":"https://api.github.com/repos/TUW-GEO/pytesmo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TUW-GEO/pytesmo/merges","archive_url":"https://api.github.com/repos/TUW-GEO/pytesmo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TUW-GEO/pytesmo/downloads","issues_url":"https://api.github.com/repos/TUW-GEO/pytesmo/issues{/number}","pulls_url":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls{/number}","milestones_url":"https://api.github.com/repos/TUW-GEO/pytesmo/milestones{/number}","notifications_url":"https://api.github.com/repos/TUW-GEO/pytesmo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TUW-GEO/pytesmo/labels{/name}","releases_url":"https://api.github.com/repos/TUW-GEO/pytesmo/releases{/id}","created_at":"2013-08-12T13:22:03Z","updated_at":"2015-03-27T21:18:04Z","pushed_at":"2015-04-20T11:01:44Z","git_url":"git://github.com/TUW-GEO/pytesmo.git","ssh_url":"git@github.com:TUW-GEO/pytesmo.git","clone_url":"https://github.com/TUW-GEO/pytesmo.git","svn_url":"https://github.com/TUW-GEO/pytesmo","homepage":"http://rs.geo.tuwien.ac.at/validation_tool/pytesmo/","size":24368,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":17,"forks":3,"open_issues":17,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35"},"html":{"href":"https://github.com/TUW-GEO/pytesmo/pull/35"},"issue":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/issues/35"},"comments":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/TUW-GEO/pytesmo/statuses/e64b1f46844755b2067df665be1a078e4c65516d"}}}}