{"action":"created","comment":{"url":"https://api.github.com/repos/textpipe/textpipe/pulls/comments/238552012","pull_request_review_id":181119450,"id":238552012,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODU1MjAxMg==","diff_hunk":"@@ -47,3 +48,103 @@ def test_load_save():\n         p = Pipeline.load(fp.name)\n \n     assert p.language == PIPE.language\n+\n+\n+def test_step_definitions_defaulted_properly():\n+    \"\"\"\n+    Steps are structured properly\n+    :return:\n+    \"\"\"\n+    test_pipe = Pipeline([('Raw',)])\n+\n+    assert test_pipe.steps[0] == ('Raw', {})\n+\n+\n+def test_steps_definitions():\n+    \"\"\"\n+    Steps are structured properly\n+    :return:\n+    \"\"\"\n+    test_pipe = Pipeline(STEPS)\n+\n+    assert test_pipe.steps[0] == ('Raw', {})\n+    assert test_pipe.steps[-1] == STEPS[-1]\n+\n+def test_register_operation():\n+    \"\"\"\n+        The most simple way to extend the pipeline operations is by passing a\n+        function with proper arguments.\n+        :return:\n+    \"\"\"\n+    test_pipe = Pipeline(STEPS, models=[('ents', 'nl', model_path_nl), ('other_identifier', 'en', model_path_en)])\n+\n+    def custom_op(doc, **kwargs):\n+        return kwargs\n+\n+    test_pipe.register_operation('CUSTOM_STEP', custom_op)\n+    assert len(test_pipe._operations) == len(STEPS) + 1\n+\n+def test_register_op_with_extending_steps_works():\n+    \"\"\"\n+    Calling the custom pipeline operation with an argument should yield the same\n+    arguments passed back as a result\n+    :return:\n+    \"\"\"\n+    test_pipe = Pipeline(STEPS, **PIPELINE_DEF_KWARGS)\n+\n+    def custom_op(doc, context=None, settings=None, **kwargs):\n+        return settings\n+\n+    custom_argument = {'argument' :1 }\n+    test_pipe.register_operation('CUSTOM_STEP', custom_op)\n+    test_pipe.steps.append(('CUSTOM_STEP', custom_argument ))","path":"tests/test_pipeline.py","position":86,"original_position":86,"commit_id":"0377ecee4e3cf4865b9cb1fc6cbf8bd8571b8a78","original_commit_id":"0377ecee4e3cf4865b9cb1fc6cbf8bd8571b8a78","user":{"login":"anneschuth","id":586744,"node_id":"MDQ6VXNlcjU4Njc0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/586744?v=4","gravatar_id":"","url":"https://api.github.com/users/anneschuth","html_url":"https://github.com/anneschuth","followers_url":"https://api.github.com/users/anneschuth/followers","following_url":"https://api.github.com/users/anneschuth/following{/other_user}","gists_url":"https://api.github.com/users/anneschuth/gists{/gist_id}","starred_url":"https://api.github.com/users/anneschuth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anneschuth/subscriptions","organizations_url":"https://api.github.com/users/anneschuth/orgs","repos_url":"https://api.github.com/users/anneschuth/repos","events_url":"https://api.github.com/users/anneschuth/events{/privacy}","received_events_url":"https://api.github.com/users/anneschuth/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n    test_pipe.steps.append(('CUSTOM_STEP', custom_argument))\r\n```","created_at":"2018-12-04T07:33:20Z","updated_at":"2018-12-04T07:33:21Z","html_url":"https://github.com/textpipe/textpipe/pull/93#discussion_r238552012","pull_request_url":"https://api.github.com/repos/textpipe/textpipe/pulls/93","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/textpipe/textpipe/pulls/comments/238552012"},"html":{"href":"https://github.com/textpipe/textpipe/pull/93#discussion_r238552012"},"pull_request":{"href":"https://api.github.com/repos/textpipe/textpipe/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/textpipe/textpipe/pulls/93","id":234975350,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0OTc1MzUw","html_url":"https://github.com/textpipe/textpipe/pull/93","diff_url":"https://github.com/textpipe/textpipe/pull/93.diff","patch_url":"https://github.com/textpipe/textpipe/pull/93.patch","issue_url":"https://api.github.com/repos/textpipe/textpipe/issues/93","number":93,"state":"open","locked":false,"title":"Extensible and transparent pipeline operations","user":{"login":"bcambel","id":144385,"node_id":"MDQ6VXNlcjE0NDM4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/144385?v=4","gravatar_id":"","url":"https://api.github.com/users/bcambel","html_url":"https://github.com/bcambel","followers_url":"https://api.github.com/users/bcambel/followers","following_url":"https://api.github.com/users/bcambel/following{/other_user}","gists_url":"https://api.github.com/users/bcambel/gists{/gist_id}","starred_url":"https://api.github.com/users/bcambel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcambel/subscriptions","organizations_url":"https://api.github.com/users/bcambel/orgs","repos_url":"https://api.github.com/users/bcambel/repos","events_url":"https://api.github.com/users/bcambel/events{/privacy}","received_events_url":"https://api.github.com/users/bcambel/received_events","type":"User","site_admin":false},"body":"- change operation's registry from list to dict\r\n- global pipeline data is available across operations via the `context` kwarg\r\n- load custom operations using `register_operation` in pipeline\r\n- custom steps (operations) with arguments","created_at":"2018-11-30T12:42:16Z","updated_at":"2018-12-04T07:33:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"644c4afc3bd6915b16a42231fc94a76604ef3eab","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dodijk","id":698909,"node_id":"MDQ6VXNlcjY5ODkwOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/698909?v=4","gravatar_id":"","url":"https://api.github.com/users/dodijk","html_url":"https://github.com/dodijk","followers_url":"https://api.github.com/users/dodijk/followers","following_url":"https://api.github.com/users/dodijk/following{/other_user}","gists_url":"https://api.github.com/users/dodijk/gists{/gist_id}","starred_url":"https://api.github.com/users/dodijk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dodijk/subscriptions","organizations_url":"https://api.github.com/users/dodijk/orgs","repos_url":"https://api.github.com/users/dodijk/repos","events_url":"https://api.github.com/users/dodijk/events{/privacy}","received_events_url":"https://api.github.com/users/dodijk/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/textpipe/textpipe/pulls/93/commits","review_comments_url":"https://api.github.com/repos/textpipe/textpipe/pulls/93/comments","review_comment_url":"https://api.github.com/repos/textpipe/textpipe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/textpipe/textpipe/issues/93/comments","statuses_url":"https://api.github.com/repos/textpipe/textpipe/statuses/0377ecee4e3cf4865b9cb1fc6cbf8bd8571b8a78","head":{"label":"textpipe:feature/pipeline-improvements","ref":"feature/pipeline-improvements","sha":"0377ecee4e3cf4865b9cb1fc6cbf8bd8571b8a78","user":{"login":"textpipe","id":40492530,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDkyNTMw","avatar_url":"https://avatars2.githubusercontent.com/u/40492530?v=4","gravatar_id":"","url":"https://api.github.com/users/textpipe","html_url":"https://github.com/textpipe","followers_url":"https://api.github.com/users/textpipe/followers","following_url":"https://api.github.com/users/textpipe/following{/other_user}","gists_url":"https://api.github.com/users/textpipe/gists{/gist_id}","starred_url":"https://api.github.com/users/textpipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textpipe/subscriptions","organizations_url":"https://api.github.com/users/textpipe/orgs","repos_url":"https://api.github.com/users/textpipe/repos","events_url":"https://api.github.com/users/textpipe/events{/privacy}","received_events_url":"https://api.github.com/users/textpipe/received_events","type":"Organization","site_admin":false},"repo":{"id":138195162,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgxOTUxNjI=","name":"textpipe","full_name":"textpipe/textpipe","private":false,"owner":{"login":"textpipe","id":40492530,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDkyNTMw","avatar_url":"https://avatars2.githubusercontent.com/u/40492530?v=4","gravatar_id":"","url":"https://api.github.com/users/textpipe","html_url":"https://github.com/textpipe","followers_url":"https://api.github.com/users/textpipe/followers","following_url":"https://api.github.com/users/textpipe/following{/other_user}","gists_url":"https://api.github.com/users/textpipe/gists{/gist_id}","starred_url":"https://api.github.com/users/textpipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textpipe/subscriptions","organizations_url":"https://api.github.com/users/textpipe/orgs","repos_url":"https://api.github.com/users/textpipe/repos","events_url":"https://api.github.com/users/textpipe/events{/privacy}","received_events_url":"https://api.github.com/users/textpipe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/textpipe/textpipe","description":"Textpipe: clean and extract metadata from text","fork":false,"url":"https://api.github.com/repos/textpipe/textpipe","forks_url":"https://api.github.com/repos/textpipe/textpipe/forks","keys_url":"https://api.github.com/repos/textpipe/textpipe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/textpipe/textpipe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/textpipe/textpipe/teams","hooks_url":"https://api.github.com/repos/textpipe/textpipe/hooks","issue_events_url":"https://api.github.com/repos/textpipe/textpipe/issues/events{/number}","events_url":"https://api.github.com/repos/textpipe/textpipe/events","assignees_url":"https://api.github.com/repos/textpipe/textpipe/assignees{/user}","branches_url":"https://api.github.com/repos/textpipe/textpipe/branches{/branch}","tags_url":"https://api.github.com/repos/textpipe/textpipe/tags","blobs_url":"https://api.github.com/repos/textpipe/textpipe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/textpipe/textpipe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/textpipe/textpipe/git/refs{/sha}","trees_url":"https://api.github.com/repos/textpipe/textpipe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/textpipe/textpipe/statuses/{sha}","languages_url":"https://api.github.com/repos/textpipe/textpipe/languages","stargazers_url":"https://api.github.com/repos/textpipe/textpipe/stargazers","contributors_url":"https://api.github.com/repos/textpipe/textpipe/contributors","subscribers_url":"https://api.github.com/repos/textpipe/textpipe/subscribers","subscription_url":"https://api.github.com/repos/textpipe/textpipe/subscription","commits_url":"https://api.github.com/repos/textpipe/textpipe/commits{/sha}","git_commits_url":"https://api.github.com/repos/textpipe/textpipe/git/commits{/sha}","comments_url":"https://api.github.com/repos/textpipe/textpipe/comments{/number}","issue_comment_url":"https://api.github.com/repos/textpipe/textpipe/issues/comments{/number}","contents_url":"https://api.github.com/repos/textpipe/textpipe/contents/{+path}","compare_url":"https://api.github.com/repos/textpipe/textpipe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/textpipe/textpipe/merges","archive_url":"https://api.github.com/repos/textpipe/textpipe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/textpipe/textpipe/downloads","issues_url":"https://api.github.com/repos/textpipe/textpipe/issues{/number}","pulls_url":"https://api.github.com/repos/textpipe/textpipe/pulls{/number}","milestones_url":"https://api.github.com/repos/textpipe/textpipe/milestones{/number}","notifications_url":"https://api.github.com/repos/textpipe/textpipe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/textpipe/textpipe/labels{/name}","releases_url":"https://api.github.com/repos/textpipe/textpipe/releases{/id}","deployments_url":"https://api.github.com/repos/textpipe/textpipe/deployments","created_at":"2018-06-21T16:23:32Z","updated_at":"2018-12-03T19:52:22Z","pushed_at":"2018-12-04T07:05:52Z","git_url":"git://github.com/textpipe/textpipe.git","ssh_url":"git@github.com:textpipe/textpipe.git","clone_url":"https://github.com/textpipe/textpipe.git","svn_url":"https://github.com/textpipe/textpipe","homepage":"","size":145,"stargazers_count":48,"watchers_count":48,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":21,"watchers":48,"default_branch":"master"}},"base":{"label":"textpipe:master","ref":"master","sha":"b09abc8246486d388cecb15139e3f3184d90cf26","user":{"login":"textpipe","id":40492530,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDkyNTMw","avatar_url":"https://avatars2.githubusercontent.com/u/40492530?v=4","gravatar_id":"","url":"https://api.github.com/users/textpipe","html_url":"https://github.com/textpipe","followers_url":"https://api.github.com/users/textpipe/followers","following_url":"https://api.github.com/users/textpipe/following{/other_user}","gists_url":"https://api.github.com/users/textpipe/gists{/gist_id}","starred_url":"https://api.github.com/users/textpipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textpipe/subscriptions","organizations_url":"https://api.github.com/users/textpipe/orgs","repos_url":"https://api.github.com/users/textpipe/repos","events_url":"https://api.github.com/users/textpipe/events{/privacy}","received_events_url":"https://api.github.com/users/textpipe/received_events","type":"Organization","site_admin":false},"repo":{"id":138195162,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgxOTUxNjI=","name":"textpipe","full_name":"textpipe/textpipe","private":false,"owner":{"login":"textpipe","id":40492530,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDkyNTMw","avatar_url":"https://avatars2.githubusercontent.com/u/40492530?v=4","gravatar_id":"","url":"https://api.github.com/users/textpipe","html_url":"https://github.com/textpipe","followers_url":"https://api.github.com/users/textpipe/followers","following_url":"https://api.github.com/users/textpipe/following{/other_user}","gists_url":"https://api.github.com/users/textpipe/gists{/gist_id}","starred_url":"https://api.github.com/users/textpipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textpipe/subscriptions","organizations_url":"https://api.github.com/users/textpipe/orgs","repos_url":"https://api.github.com/users/textpipe/repos","events_url":"https://api.github.com/users/textpipe/events{/privacy}","received_events_url":"https://api.github.com/users/textpipe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/textpipe/textpipe","description":"Textpipe: clean and extract metadata from text","fork":false,"url":"https://api.github.com/repos/textpipe/textpipe","forks_url":"https://api.github.com/repos/textpipe/textpipe/forks","keys_url":"https://api.github.com/repos/textpipe/textpipe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/textpipe/textpipe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/textpipe/textpipe/teams","hooks_url":"https://api.github.com/repos/textpipe/textpipe/hooks","issue_events_url":"https://api.github.com/repos/textpipe/textpipe/issues/events{/number}","events_url":"https://api.github.com/repos/textpipe/textpipe/events","assignees_url":"https://api.github.com/repos/textpipe/textpipe/assignees{/user}","branches_url":"https://api.github.com/repos/textpipe/textpipe/branches{/branch}","tags_url":"https://api.github.com/repos/textpipe/textpipe/tags","blobs_url":"https://api.github.com/repos/textpipe/textpipe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/textpipe/textpipe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/textpipe/textpipe/git/refs{/sha}","trees_url":"https://api.github.com/repos/textpipe/textpipe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/textpipe/textpipe/statuses/{sha}","languages_url":"https://api.github.com/repos/textpipe/textpipe/languages","stargazers_url":"https://api.github.com/repos/textpipe/textpipe/stargazers","contributors_url":"https://api.github.com/repos/textpipe/textpipe/contributors","subscribers_url":"https://api.github.com/repos/textpipe/textpipe/subscribers","subscription_url":"https://api.github.com/repos/textpipe/textpipe/subscription","commits_url":"https://api.github.com/repos/textpipe/textpipe/commits{/sha}","git_commits_url":"https://api.github.com/repos/textpipe/textpipe/git/commits{/sha}","comments_url":"https://api.github.com/repos/textpipe/textpipe/comments{/number}","issue_comment_url":"https://api.github.com/repos/textpipe/textpipe/issues/comments{/number}","contents_url":"https://api.github.com/repos/textpipe/textpipe/contents/{+path}","compare_url":"https://api.github.com/repos/textpipe/textpipe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/textpipe/textpipe/merges","archive_url":"https://api.github.com/repos/textpipe/textpipe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/textpipe/textpipe/downloads","issues_url":"https://api.github.com/repos/textpipe/textpipe/issues{/number}","pulls_url":"https://api.github.com/repos/textpipe/textpipe/pulls{/number}","milestones_url":"https://api.github.com/repos/textpipe/textpipe/milestones{/number}","notifications_url":"https://api.github.com/repos/textpipe/textpipe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/textpipe/textpipe/labels{/name}","releases_url":"https://api.github.com/repos/textpipe/textpipe/releases{/id}","deployments_url":"https://api.github.com/repos/textpipe/textpipe/deployments","created_at":"2018-06-21T16:23:32Z","updated_at":"2018-12-03T19:52:22Z","pushed_at":"2018-12-04T07:05:52Z","git_url":"git://github.com/textpipe/textpipe.git","ssh_url":"git@github.com:textpipe/textpipe.git","clone_url":"https://github.com/textpipe/textpipe.git","svn_url":"https://github.com/textpipe/textpipe","homepage":"","size":145,"stargazers_count":48,"watchers_count":48,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3,"open_issues":21,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/textpipe/textpipe/pulls/93"},"html":{"href":"https://github.com/textpipe/textpipe/pull/93"},"issue":{"href":"https://api.github.com/repos/textpipe/textpipe/issues/93"},"comments":{"href":"https://api.github.com/repos/textpipe/textpipe/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/textpipe/textpipe/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/textpipe/textpipe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/textpipe/textpipe/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/textpipe/textpipe/statuses/0377ecee4e3cf4865b9cb1fc6cbf8bd8571b8a78"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"anneschuth"}}