{"action":"created","comment":{"url":"https://api.github.com/repos/IAMconsortium/pyam/pulls/comments/222909310","pull_request_review_id":161911099,"id":222909310,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjkwOTMxMA==","diff_hunk":"@@ -0,0 +1,37 @@\n+#!/usr/bin/env python3\n+# -*- coding: utf-8 -*-\n+\n+import numpy as np\n+import pandas as pd\n+from pyam import cross_threshold\n+import pytest\n+\n+\n+def test_cross_treshold():\n+    y = pd.Series(data=[np.nan, 1, 3, 1], index=[2002, 2005, 2007, 2013])\n+    obs = cross_threshold(y, 2)\n+    assert obs == [2007, 2011]\n+\n+\n+def test_cross_treshold_empty():\n+    y = pd.Series(data=[np.nan, 1, 3, 1], index=[2002, 2005, 2007, 2013])\n+    obs = cross_threshold(y, 4)\n+    assert obs == []\n+\n+\n+def test_cross_treshold_from_below():\n+    y = pd.Series(data=[np.nan, 1, 3, 1], index=[2002, 2005, 2007, 2013])\n+    obs = cross_threshold(y, 2, direction='from below')\n+    assert obs == [2007]\n+\n+\n+def test_cross_treshold_from_above():\n+    y = pd.Series(data=[np.nan, 1, 3, 1], index=[2002, 2005, 2007, 2013])\n+    obs = cross_threshold(y, 2, direction='from above')\n+    assert obs == [2011]\n+\n+\n+def test_cross_treshold_direction_error():\n+    y = pd.Series(data=[np.nan, 1, 3, 1], index=[2002, 2005, 2007, 2013])\n+    pytest.raises(ValueError, cross_threshold, x = y, threshold=2,\n+                  direction='up')","path":"tests/test_timeseries.py","position":37,"original_position":37,"commit_id":"3a68263f228452f1b79be0b70f2225519bfad11a","original_commit_id":"3a68263f228452f1b79be0b70f2225519bfad11a","user":{"login":"stickler-ci","id":16011037,"node_id":"MDQ6VXNlcjE2MDExMDM3","avatar_url":"https://avatars3.githubusercontent.com/u/16011037?v=4","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"W292 no newline at end of file","created_at":"2018-10-05T07:04:07Z","updated_at":"2018-10-05T07:04:07Z","html_url":"https://github.com/IAMconsortium/pyam/pull/101#discussion_r222909310","pull_request_url":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/IAMconsortium/pyam/pulls/comments/222909310"},"html":{"href":"https://github.com/IAMconsortium/pyam/pull/101#discussion_r222909310"},"pull_request":{"href":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101","id":219271480,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MjcxNDgw","html_url":"https://github.com/IAMconsortium/pyam/pull/101","diff_url":"https://github.com/IAMconsortium/pyam/pull/101.diff","patch_url":"https://github.com/IAMconsortium/pyam/pull/101.patch","issue_url":"https://api.github.com/repos/IAMconsortium/pyam/issues/101","number":101,"state":"open","locked":false,"title":"add a function to retrieve years in which a series crosses a threshold","user":{"login":"danielhuppmann","id":16931589,"node_id":"MDQ6VXNlcjE2OTMxNTg5","avatar_url":"https://avatars2.githubusercontent.com/u/16931589?v=4","gravatar_id":"","url":"https://api.github.com/users/danielhuppmann","html_url":"https://github.com/danielhuppmann","followers_url":"https://api.github.com/users/danielhuppmann/followers","following_url":"https://api.github.com/users/danielhuppmann/following{/other_user}","gists_url":"https://api.github.com/users/danielhuppmann/gists{/gist_id}","starred_url":"https://api.github.com/users/danielhuppmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielhuppmann/subscriptions","organizations_url":"https://api.github.com/users/danielhuppmann/orgs","repos_url":"https://api.github.com/users/danielhuppmann/repos","events_url":"https://api.github.com/users/danielhuppmann/events{/privacy}","received_events_url":"https://api.github.com/users/danielhuppmann/received_events","type":"User","site_admin":false},"body":"# Please confirm that this PR has done the following:\r\n\r\n- [x] Tests Added\r\n- [x] Documentation Added\r\n- [x] Description in RELEASE_NOTES.md Added\r\n\r\n## Adding to RELEASE_NOTES.md (remove section after adding to RELEASE_NOTES.md)\r\n\r\nPlease add a single line in the release notes similar to the following:\r\n\r\n```\r\n- (#XX)[http://link-to-pr.com] Added feature which does something\r\n```\r\n\r\n# Description of PR\r\n\r\nThis PR adds a `pyam.cross_threshold()` function to retrieve a list of years in which a `pd.Series` (e.g., a timeseries row) crosses a given threshold.","created_at":"2018-10-01T06:29:55Z","updated_at":"2018-10-05T07:04:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"987fe427d18bccc4d63394cf1449568ce0bc9b7e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gidden","id":1392657,"node_id":"MDQ6VXNlcjEzOTI2NTc=","avatar_url":"https://avatars3.githubusercontent.com/u/1392657?v=4","gravatar_id":"","url":"https://api.github.com/users/gidden","html_url":"https://github.com/gidden","followers_url":"https://api.github.com/users/gidden/followers","following_url":"https://api.github.com/users/gidden/following{/other_user}","gists_url":"https://api.github.com/users/gidden/gists{/gist_id}","starred_url":"https://api.github.com/users/gidden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gidden/subscriptions","organizations_url":"https://api.github.com/users/gidden/orgs","repos_url":"https://api.github.com/users/gidden/repos","events_url":"https://api.github.com/users/gidden/events{/privacy}","received_events_url":"https://api.github.com/users/gidden/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101/commits","review_comments_url":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101/comments","review_comment_url":"https://api.github.com/repos/IAMconsortium/pyam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IAMconsortium/pyam/issues/101/comments","statuses_url":"https://api.github.com/repos/IAMconsortium/pyam/statuses/3a68263f228452f1b79be0b70f2225519bfad11a","head":{"label":"danielhuppmann:cross_threshold","ref":"cross_threshold","sha":"3a68263f228452f1b79be0b70f2225519bfad11a","user":{"login":"danielhuppmann","id":16931589,"node_id":"MDQ6VXNlcjE2OTMxNTg5","avatar_url":"https://avatars2.githubusercontent.com/u/16931589?v=4","gravatar_id":"","url":"https://api.github.com/users/danielhuppmann","html_url":"https://github.com/danielhuppmann","followers_url":"https://api.github.com/users/danielhuppmann/followers","following_url":"https://api.github.com/users/danielhuppmann/following{/other_user}","gists_url":"https://api.github.com/users/danielhuppmann/gists{/gist_id}","starred_url":"https://api.github.com/users/danielhuppmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielhuppmann/subscriptions","organizations_url":"https://api.github.com/users/danielhuppmann/orgs","repos_url":"https://api.github.com/users/danielhuppmann/repos","events_url":"https://api.github.com/users/danielhuppmann/events{/privacy}","received_events_url":"https://api.github.com/users/danielhuppmann/received_events","type":"User","site_admin":false},"repo":{"id":120439587,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA0Mzk1ODc=","name":"pyam","full_name":"danielhuppmann/pyam","private":false,"owner":{"login":"danielhuppmann","id":16931589,"node_id":"MDQ6VXNlcjE2OTMxNTg5","avatar_url":"https://avatars2.githubusercontent.com/u/16931589?v=4","gravatar_id":"","url":"https://api.github.com/users/danielhuppmann","html_url":"https://github.com/danielhuppmann","followers_url":"https://api.github.com/users/danielhuppmann/followers","following_url":"https://api.github.com/users/danielhuppmann/following{/other_user}","gists_url":"https://api.github.com/users/danielhuppmann/gists{/gist_id}","starred_url":"https://api.github.com/users/danielhuppmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielhuppmann/subscriptions","organizations_url":"https://api.github.com/users/danielhuppmann/orgs","repos_url":"https://api.github.com/users/danielhuppmann/repos","events_url":"https://api.github.com/users/danielhuppmann/events{/privacy}","received_events_url":"https://api.github.com/users/danielhuppmann/received_events","type":"User","site_admin":false},"html_url":"https://github.com/danielhuppmann/pyam","description":" an open-source Python package for IAM scenario analysis and visualization","fork":true,"url":"https://api.github.com/repos/danielhuppmann/pyam","forks_url":"https://api.github.com/repos/danielhuppmann/pyam/forks","keys_url":"https://api.github.com/repos/danielhuppmann/pyam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielhuppmann/pyam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielhuppmann/pyam/teams","hooks_url":"https://api.github.com/repos/danielhuppmann/pyam/hooks","issue_events_url":"https://api.github.com/repos/danielhuppmann/pyam/issues/events{/number}","events_url":"https://api.github.com/repos/danielhuppmann/pyam/events","assignees_url":"https://api.github.com/repos/danielhuppmann/pyam/assignees{/user}","branches_url":"https://api.github.com/repos/danielhuppmann/pyam/branches{/branch}","tags_url":"https://api.github.com/repos/danielhuppmann/pyam/tags","blobs_url":"https://api.github.com/repos/danielhuppmann/pyam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielhuppmann/pyam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielhuppmann/pyam/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielhuppmann/pyam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielhuppmann/pyam/statuses/{sha}","languages_url":"https://api.github.com/repos/danielhuppmann/pyam/languages","stargazers_url":"https://api.github.com/repos/danielhuppmann/pyam/stargazers","contributors_url":"https://api.github.com/repos/danielhuppmann/pyam/contributors","subscribers_url":"https://api.github.com/repos/danielhuppmann/pyam/subscribers","subscription_url":"https://api.github.com/repos/danielhuppmann/pyam/subscription","commits_url":"https://api.github.com/repos/danielhuppmann/pyam/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielhuppmann/pyam/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielhuppmann/pyam/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielhuppmann/pyam/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielhuppmann/pyam/contents/{+path}","compare_url":"https://api.github.com/repos/danielhuppmann/pyam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielhuppmann/pyam/merges","archive_url":"https://api.github.com/repos/danielhuppmann/pyam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielhuppmann/pyam/downloads","issues_url":"https://api.github.com/repos/danielhuppmann/pyam/issues{/number}","pulls_url":"https://api.github.com/repos/danielhuppmann/pyam/pulls{/number}","milestones_url":"https://api.github.com/repos/danielhuppmann/pyam/milestones{/number}","notifications_url":"https://api.github.com/repos/danielhuppmann/pyam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielhuppmann/pyam/labels{/name}","releases_url":"https://api.github.com/repos/danielhuppmann/pyam/releases{/id}","deployments_url":"https://api.github.com/repos/danielhuppmann/pyam/deployments","created_at":"2018-02-06T10:36:13Z","updated_at":"2018-09-21T09:58:25Z","pushed_at":"2018-10-05T07:03:59Z","git_url":"git://github.com/danielhuppmann/pyam.git","ssh_url":"git@github.com:danielhuppmann/pyam.git","clone_url":"https://github.com/danielhuppmann/pyam.git","svn_url":"https://github.com/danielhuppmann/pyam","homepage":"","size":11102,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"IAMconsortium:master","ref":"master","sha":"06f3aaf0d8e8ebeac4fe61fc509f9f3dc9b003e1","user":{"login":"IAMconsortium","id":19565808,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTY1ODA4","avatar_url":"https://avatars2.githubusercontent.com/u/19565808?v=4","gravatar_id":"","url":"https://api.github.com/users/IAMconsortium","html_url":"https://github.com/IAMconsortium","followers_url":"https://api.github.com/users/IAMconsortium/followers","following_url":"https://api.github.com/users/IAMconsortium/following{/other_user}","gists_url":"https://api.github.com/users/IAMconsortium/gists{/gist_id}","starred_url":"https://api.github.com/users/IAMconsortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IAMconsortium/subscriptions","organizations_url":"https://api.github.com/users/IAMconsortium/orgs","repos_url":"https://api.github.com/users/IAMconsortium/repos","events_url":"https://api.github.com/users/IAMconsortium/events{/privacy}","received_events_url":"https://api.github.com/users/IAMconsortium/received_events","type":"Organization","site_admin":false},"repo":{"id":113359260,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMzNTkyNjA=","name":"pyam","full_name":"IAMconsortium/pyam","private":false,"owner":{"login":"IAMconsortium","id":19565808,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTY1ODA4","avatar_url":"https://avatars2.githubusercontent.com/u/19565808?v=4","gravatar_id":"","url":"https://api.github.com/users/IAMconsortium","html_url":"https://github.com/IAMconsortium","followers_url":"https://api.github.com/users/IAMconsortium/followers","following_url":"https://api.github.com/users/IAMconsortium/following{/other_user}","gists_url":"https://api.github.com/users/IAMconsortium/gists{/gist_id}","starred_url":"https://api.github.com/users/IAMconsortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IAMconsortium/subscriptions","organizations_url":"https://api.github.com/users/IAMconsortium/orgs","repos_url":"https://api.github.com/users/IAMconsortium/repos","events_url":"https://api.github.com/users/IAMconsortium/events{/privacy}","received_events_url":"https://api.github.com/users/IAMconsortium/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/IAMconsortium/pyam","description":"an open-source Python package for IAM scenario analysis and visualization","fork":false,"url":"https://api.github.com/repos/IAMconsortium/pyam","forks_url":"https://api.github.com/repos/IAMconsortium/pyam/forks","keys_url":"https://api.github.com/repos/IAMconsortium/pyam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IAMconsortium/pyam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IAMconsortium/pyam/teams","hooks_url":"https://api.github.com/repos/IAMconsortium/pyam/hooks","issue_events_url":"https://api.github.com/repos/IAMconsortium/pyam/issues/events{/number}","events_url":"https://api.github.com/repos/IAMconsortium/pyam/events","assignees_url":"https://api.github.com/repos/IAMconsortium/pyam/assignees{/user}","branches_url":"https://api.github.com/repos/IAMconsortium/pyam/branches{/branch}","tags_url":"https://api.github.com/repos/IAMconsortium/pyam/tags","blobs_url":"https://api.github.com/repos/IAMconsortium/pyam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IAMconsortium/pyam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IAMconsortium/pyam/git/refs{/sha}","trees_url":"https://api.github.com/repos/IAMconsortium/pyam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IAMconsortium/pyam/statuses/{sha}","languages_url":"https://api.github.com/repos/IAMconsortium/pyam/languages","stargazers_url":"https://api.github.com/repos/IAMconsortium/pyam/stargazers","contributors_url":"https://api.github.com/repos/IAMconsortium/pyam/contributors","subscribers_url":"https://api.github.com/repos/IAMconsortium/pyam/subscribers","subscription_url":"https://api.github.com/repos/IAMconsortium/pyam/subscription","commits_url":"https://api.github.com/repos/IAMconsortium/pyam/commits{/sha}","git_commits_url":"https://api.github.com/repos/IAMconsortium/pyam/git/commits{/sha}","comments_url":"https://api.github.com/repos/IAMconsortium/pyam/comments{/number}","issue_comment_url":"https://api.github.com/repos/IAMconsortium/pyam/issues/comments{/number}","contents_url":"https://api.github.com/repos/IAMconsortium/pyam/contents/{+path}","compare_url":"https://api.github.com/repos/IAMconsortium/pyam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IAMconsortium/pyam/merges","archive_url":"https://api.github.com/repos/IAMconsortium/pyam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IAMconsortium/pyam/downloads","issues_url":"https://api.github.com/repos/IAMconsortium/pyam/issues{/number}","pulls_url":"https://api.github.com/repos/IAMconsortium/pyam/pulls{/number}","milestones_url":"https://api.github.com/repos/IAMconsortium/pyam/milestones{/number}","notifications_url":"https://api.github.com/repos/IAMconsortium/pyam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IAMconsortium/pyam/labels{/name}","releases_url":"https://api.github.com/repos/IAMconsortium/pyam/releases{/id}","deployments_url":"https://api.github.com/repos/IAMconsortium/pyam/deployments","created_at":"2017-12-06T19:35:45Z","updated_at":"2018-10-04T14:40:44Z","pushed_at":"2018-10-05T07:04:01Z","git_url":"git://github.com/IAMconsortium/pyam.git","ssh_url":"git@github.com:IAMconsortium/pyam.git","clone_url":"https://github.com/IAMconsortium/pyam.git","svn_url":"https://github.com/IAMconsortium/pyam","homepage":"https://software.ene.iiasa.ac.at/pyam/","size":10800,"stargazers_count":11,"watchers_count":11,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":15,"open_issues":15,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101"},"html":{"href":"https://github.com/IAMconsortium/pyam/pull/101"},"issue":{"href":"https://api.github.com/repos/IAMconsortium/pyam/issues/101"},"comments":{"href":"https://api.github.com/repos/IAMconsortium/pyam/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/IAMconsortium/pyam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IAMconsortium/pyam/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/IAMconsortium/pyam/statuses/3a68263f228452f1b79be0b70f2225519bfad11a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"stickler-ci"}}