{"action":"created","comment":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/comments/61767642","id":61767642,"diff_hunk":"@@ -530,9 +533,62 @@ cdef class Datetime64Overwrite(Datetime64Adjustment):\n     \"\"\"\n     cpdef mutate(self, int64_t[:, :] data):\n         cdef Py_ssize_t row, col\n+        cdef int64_t value = self.value\n \n         # last_col + 1 because last_col should also be affected.\n         for col in range(self.first_col, self.last_col + 1):\n             # last_row + 1 because last_row should also be affected.\n             for row in range(self.first_row, self.last_row + 1):\n-                data[row, col] = self.value\n+                data[row, col] = value\n+\n+\n+cdef class _ObjectAdjustment(Adjustment):\n+    \"\"\"\n+    Base class for adjustments that operate on arbitrary objects.\n+\n+    We use only this for categorical data, where our data buffer is an array of\n+    indices into an array of unique Python string objects.\n+    \"\"\"\n+    cdef:\n+        readonly object value\n+\n+    def __init__(self,\n+                 Py_ssize_t first_row,\n+                 Py_ssize_t last_row,\n+                 Py_ssize_t first_col,\n+                 Py_ssize_t last_col,\n+                 object value):\n+        super(Adjustment, self).__init__(","path":"zipline/lib/adjustment.pyx","position":75,"original_position":75,"commit_id":"b51102a986721874373b830422075b783bf409b2","original_commit_id":"b51102a986721874373b830422075b783bf409b2","user":{"login":"dmichalowicz","id":13137798,"avatar_url":"https://avatars.githubusercontent.com/u/13137798?v=3","gravatar_id":"","url":"https://api.github.com/users/dmichalowicz","html_url":"https://github.com/dmichalowicz","followers_url":"https://api.github.com/users/dmichalowicz/followers","following_url":"https://api.github.com/users/dmichalowicz/following{/other_user}","gists_url":"https://api.github.com/users/dmichalowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/dmichalowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmichalowicz/subscriptions","organizations_url":"https://api.github.com/users/dmichalowicz/orgs","repos_url":"https://api.github.com/users/dmichalowicz/repos","events_url":"https://api.github.com/users/dmichalowicz/events{/privacy}","received_events_url":"https://api.github.com/users/dmichalowicz/received_events","type":"User","site_admin":false},"body":"Did you mean for this to be `super(_ObjectAdjustment, ...)`?","created_at":"2016-05-02T17:05:34Z","updated_at":"2016-05-02T17:05:34Z","html_url":"https://github.com/quantopian/zipline/pull/1174#discussion_r61767642","pull_request_url":"https://api.github.com/repos/quantopian/zipline/pulls/1174","_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments/61767642"},"html":{"href":"https://github.com/quantopian/zipline/pull/1174#discussion_r61767642"},"pull_request":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1174"}}},"pull_request":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/1174","id":68396879,"html_url":"https://github.com/quantopian/zipline/pull/1174","diff_url":"https://github.com/quantopian/zipline/pull/1174.diff","patch_url":"https://github.com/quantopian/zipline/pull/1174.patch","issue_url":"https://api.github.com/repos/quantopian/zipline/issues/1174","number":1174,"state":"open","locked":false,"title":"ENH: Add support for strings in Pipeline.","user":{"login":"ssanderson","id":1588357,"avatar_url":"https://avatars.githubusercontent.com/u/1588357?v=3","gravatar_id":"","url":"https://api.github.com/users/ssanderson","html_url":"https://github.com/ssanderson","followers_url":"https://api.github.com/users/ssanderson/followers","following_url":"https://api.github.com/users/ssanderson/following{/other_user}","gists_url":"https://api.github.com/users/ssanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/ssanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssanderson/subscriptions","organizations_url":"https://api.github.com/users/ssanderson/orgs","repos_url":"https://api.github.com/users/ssanderson/repos","events_url":"https://api.github.com/users/ssanderson/events{/privacy}","received_events_url":"https://api.github.com/users/ssanderson/received_events","type":"User","site_admin":false},"body":"- Adds a new class, ``LabelArray``, which is a subclass of np.ndarray.\r\n  LabelArray is conceptually similar to pandas.Categorical, in that it\r\n  stores data with many duplicate values as indices into an array of\r\n  unique values.  For string data with many duplicates (e.g. time-series\r\n  of tickers or or industry classifications), this provides multiple\r\n  orders of magnitude of improvement when doing string operations,\r\n  especially string comparison/matching operations.\r\n\r\n- Adds a new generic object \"specialization\" for `AdjustedArrayWindow`,\r\n  and a corresponding ObjectOverwrite adjustment.\r\n\r\n- Adds a new ``postprocess`` method to ``zipline.pipeline.term.Term``.\r\n  This method is called on the final result of any pipeline expression\r\n  after screen filtering has occurred. The default implementation of\r\n  ``postprocess`` is identity, but Classifier overrides it to coerce\r\n  string columns into pandas.Categoricals before presenting them to the\r\n  user.","created_at":"2016-04-29T16:18:49Z","updated_at":"2016-05-02T17:05:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23ee722dc53e7ef940b3a17fd656d36c17820b42","assignee":{"login":"mtydykov","id":5226409,"avatar_url":"https://avatars.githubusercontent.com/u/5226409?v=3","gravatar_id":"","url":"https://api.github.com/users/mtydykov","html_url":"https://github.com/mtydykov","followers_url":"https://api.github.com/users/mtydykov/followers","following_url":"https://api.github.com/users/mtydykov/following{/other_user}","gists_url":"https://api.github.com/users/mtydykov/gists{/gist_id}","starred_url":"https://api.github.com/users/mtydykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtydykov/subscriptions","organizations_url":"https://api.github.com/users/mtydykov/orgs","repos_url":"https://api.github.com/users/mtydykov/repos","events_url":"https://api.github.com/users/mtydykov/events{/privacy}","received_events_url":"https://api.github.com/users/mtydykov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/quantopian/zipline/pulls/1174/commits","review_comments_url":"https://api.github.com/repos/quantopian/zipline/pulls/1174/comments","review_comment_url":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quantopian/zipline/issues/1174/comments","statuses_url":"https://api.github.com/repos/quantopian/zipline/statuses/b51102a986721874373b830422075b783bf409b2","head":{"label":"quantopian:string-classifiers","ref":"string-classifiers","sha":"b51102a986721874373b830422075b783bf409b2","user":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"repo":{"id":6297520,"name":"zipline","full_name":"quantopian/zipline","owner":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quantopian/zipline","description":"Zipline, a Pythonic Algorithmic Trading Library","fork":false,"url":"https://api.github.com/repos/quantopian/zipline","forks_url":"https://api.github.com/repos/quantopian/zipline/forks","keys_url":"https://api.github.com/repos/quantopian/zipline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quantopian/zipline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quantopian/zipline/teams","hooks_url":"https://api.github.com/repos/quantopian/zipline/hooks","issue_events_url":"https://api.github.com/repos/quantopian/zipline/issues/events{/number}","events_url":"https://api.github.com/repos/quantopian/zipline/events","assignees_url":"https://api.github.com/repos/quantopian/zipline/assignees{/user}","branches_url":"https://api.github.com/repos/quantopian/zipline/branches{/branch}","tags_url":"https://api.github.com/repos/quantopian/zipline/tags","blobs_url":"https://api.github.com/repos/quantopian/zipline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quantopian/zipline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quantopian/zipline/git/refs{/sha}","trees_url":"https://api.github.com/repos/quantopian/zipline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quantopian/zipline/statuses/{sha}","languages_url":"https://api.github.com/repos/quantopian/zipline/languages","stargazers_url":"https://api.github.com/repos/quantopian/zipline/stargazers","contributors_url":"https://api.github.com/repos/quantopian/zipline/contributors","subscribers_url":"https://api.github.com/repos/quantopian/zipline/subscribers","subscription_url":"https://api.github.com/repos/quantopian/zipline/subscription","commits_url":"https://api.github.com/repos/quantopian/zipline/commits{/sha}","git_commits_url":"https://api.github.com/repos/quantopian/zipline/git/commits{/sha}","comments_url":"https://api.github.com/repos/quantopian/zipline/comments{/number}","issue_comment_url":"https://api.github.com/repos/quantopian/zipline/issues/comments{/number}","contents_url":"https://api.github.com/repos/quantopian/zipline/contents/{+path}","compare_url":"https://api.github.com/repos/quantopian/zipline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quantopian/zipline/merges","archive_url":"https://api.github.com/repos/quantopian/zipline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quantopian/zipline/downloads","issues_url":"https://api.github.com/repos/quantopian/zipline/issues{/number}","pulls_url":"https://api.github.com/repos/quantopian/zipline/pulls{/number}","milestones_url":"https://api.github.com/repos/quantopian/zipline/milestones{/number}","notifications_url":"https://api.github.com/repos/quantopian/zipline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quantopian/zipline/labels{/name}","releases_url":"https://api.github.com/repos/quantopian/zipline/releases{/id}","deployments_url":"https://api.github.com/repos/quantopian/zipline/deployments","created_at":"2012-10-19T15:50:29Z","updated_at":"2016-05-01T22:26:52Z","pushed_at":"2016-05-02T16:21:42Z","git_url":"git://github.com/quantopian/zipline.git","ssh_url":"git@github.com:quantopian/zipline.git","clone_url":"https://github.com/quantopian/zipline.git","svn_url":"https://github.com/quantopian/zipline","homepage":"","size":31887,"stargazers_count":3154,"watchers_count":3154,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":947,"mirror_url":null,"open_issues_count":152,"forks":947,"open_issues":152,"watchers":3154,"default_branch":"master"}},"base":{"label":"quantopian:master","ref":"master","sha":"e73ce0bf2be27ba6b4a227c48266dcf45f1ee6e5","user":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"repo":{"id":6297520,"name":"zipline","full_name":"quantopian/zipline","owner":{"login":"quantopian","id":1393215,"avatar_url":"https://avatars.githubusercontent.com/u/1393215?v=3","gravatar_id":"","url":"https://api.github.com/users/quantopian","html_url":"https://github.com/quantopian","followers_url":"https://api.github.com/users/quantopian/followers","following_url":"https://api.github.com/users/quantopian/following{/other_user}","gists_url":"https://api.github.com/users/quantopian/gists{/gist_id}","starred_url":"https://api.github.com/users/quantopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantopian/subscriptions","organizations_url":"https://api.github.com/users/quantopian/orgs","repos_url":"https://api.github.com/users/quantopian/repos","events_url":"https://api.github.com/users/quantopian/events{/privacy}","received_events_url":"https://api.github.com/users/quantopian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/quantopian/zipline","description":"Zipline, a Pythonic Algorithmic Trading Library","fork":false,"url":"https://api.github.com/repos/quantopian/zipline","forks_url":"https://api.github.com/repos/quantopian/zipline/forks","keys_url":"https://api.github.com/repos/quantopian/zipline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quantopian/zipline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quantopian/zipline/teams","hooks_url":"https://api.github.com/repos/quantopian/zipline/hooks","issue_events_url":"https://api.github.com/repos/quantopian/zipline/issues/events{/number}","events_url":"https://api.github.com/repos/quantopian/zipline/events","assignees_url":"https://api.github.com/repos/quantopian/zipline/assignees{/user}","branches_url":"https://api.github.com/repos/quantopian/zipline/branches{/branch}","tags_url":"https://api.github.com/repos/quantopian/zipline/tags","blobs_url":"https://api.github.com/repos/quantopian/zipline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quantopian/zipline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quantopian/zipline/git/refs{/sha}","trees_url":"https://api.github.com/repos/quantopian/zipline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quantopian/zipline/statuses/{sha}","languages_url":"https://api.github.com/repos/quantopian/zipline/languages","stargazers_url":"https://api.github.com/repos/quantopian/zipline/stargazers","contributors_url":"https://api.github.com/repos/quantopian/zipline/contributors","subscribers_url":"https://api.github.com/repos/quantopian/zipline/subscribers","subscription_url":"https://api.github.com/repos/quantopian/zipline/subscription","commits_url":"https://api.github.com/repos/quantopian/zipline/commits{/sha}","git_commits_url":"https://api.github.com/repos/quantopian/zipline/git/commits{/sha}","comments_url":"https://api.github.com/repos/quantopian/zipline/comments{/number}","issue_comment_url":"https://api.github.com/repos/quantopian/zipline/issues/comments{/number}","contents_url":"https://api.github.com/repos/quantopian/zipline/contents/{+path}","compare_url":"https://api.github.com/repos/quantopian/zipline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quantopian/zipline/merges","archive_url":"https://api.github.com/repos/quantopian/zipline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quantopian/zipline/downloads","issues_url":"https://api.github.com/repos/quantopian/zipline/issues{/number}","pulls_url":"https://api.github.com/repos/quantopian/zipline/pulls{/number}","milestones_url":"https://api.github.com/repos/quantopian/zipline/milestones{/number}","notifications_url":"https://api.github.com/repos/quantopian/zipline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quantopian/zipline/labels{/name}","releases_url":"https://api.github.com/repos/quantopian/zipline/releases{/id}","deployments_url":"https://api.github.com/repos/quantopian/zipline/deployments","created_at":"2012-10-19T15:50:29Z","updated_at":"2016-05-01T22:26:52Z","pushed_at":"2016-05-02T16:21:42Z","git_url":"git://github.com/quantopian/zipline.git","ssh_url":"git@github.com:quantopian/zipline.git","clone_url":"https://github.com/quantopian/zipline.git","svn_url":"https://github.com/quantopian/zipline","homepage":"","size":31887,"stargazers_count":3154,"watchers_count":3154,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":947,"mirror_url":null,"open_issues_count":152,"forks":947,"open_issues":152,"watchers":3154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1174"},"html":{"href":"https://github.com/quantopian/zipline/pull/1174"},"issue":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1174"},"comments":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1174/comments"},"review_comments":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1174/comments"},"review_comment":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1174/commits"},"statuses":{"href":"https://api.github.com/repos/quantopian/zipline/statuses/b51102a986721874373b830422075b783bf409b2"}}}}