{"action":"created","comment":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/comments/64943106","id":64943106,"diff_hunk":"@@ -15,6 +17,86 @@ def explode(df):\n \n try:\n     # pandas 0.16 compat\n-    sort_values = pd.DataFrame.sort_values\n+    _df_sort_values = pd.DataFrame.sort_values\n+    _series_sort_values = pd.Series.sort_values\n except AttributeError:\n-    sort_values = pd.DataFrame.sort\n+    _df_sort_values = pd.DataFrame.sort\n+    _series_sort_values = pd.Series.sort\n+\n+\n+def sort_values(ob, *args, **kwargs):\n+    if isinstance(ob, pd.DataFrame):\n+        return _df_sort_values(ob, *args, **kwargs)\n+    elif isinstance(ob, pd.Series):\n+        return _series_sort_values(ob, *args, **kwargs)\n+    raise ValueError(\n+        'sort_values expected a dataframe or series, not %s: %r' % (\n+            type(ob).__name__, ob,\n+        ),\n+    )\n+\n+\n+def _time_to_micros(time):\n+    \"\"\"Convert a time into milliseconds since midnight.\n+\n+    Parameters\n+    ----------\n+    time : datetime.time\n+        The time to convert.\n+\n+    Returns\n+    -------\n+    ms : int\n+        The number of milliseconds since midnight.\n+    \"\"\"\n+    seconds = time.hour * 60 * 60 + 60 * time.minute + time.second\n+    return 1000000 * seconds + time.microsecond\n+\n+\n+_opmap = {\n+    (True, True): (op.le, op.le),\n+    (True, False): (op.le, op.lt),\n+    (False, True): (op.lt, op.le),\n+    (False, False): (op.lt, op.lt),\n+}\n+\n+\n+def mask_between_time(dts, start, end, include_start=True, include_end=True):\n+    \"\"\"Return a mask of all of the datetimes in ``dts`` that are between\n+    ``start`` and ``end``.\n+\n+    Parameters\n+    ----------\n+    dts : pd.DatetimeIndex\n+        The index to mask.\n+    start : time\n+    end : time\n+        The start and end times.\n+    include_start : bool, optional\n+        Inclusive on ``start``.\n+    include_end : bool, optional\n+        Inclusive on ``end``.\n+\n+    Returns\n+    -------\n+    mask : np.ndarray[bool]\n+        A bool array masking ``dts``.\n+\n+    See Also\n+    --------\n+    :meth:`pandas.DatetimeIndex.indexer_between_times`\n+    \"\"\"\n+    time_micros = dts._get_time_micros()","path":"zipline/utils/pandas_utils.py","position":84,"original_position":84,"commit_id":"c569a3d571767f74f0ab830be85bcc63b78ff559","original_commit_id":"c569a3d571767f74f0ab830be85bcc63b78ff559","user":{"login":"llllllllll","id":3064397,"avatar_url":"https://avatars.githubusercontent.com/u/3064397?v=3","gravatar_id":"","url":"https://api.github.com/users/llllllllll","html_url":"https://github.com/llllllllll","followers_url":"https://api.github.com/users/llllllllll/followers","following_url":"https://api.github.com/users/llllllllll/following{/other_user}","gists_url":"https://api.github.com/users/llllllllll/gists{/gist_id}","starred_url":"https://api.github.com/users/llllllllll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llllllllll/subscriptions","organizations_url":"https://api.github.com/users/llllllllll/orgs","repos_url":"https://api.github.com/users/llllllllll/repos","events_url":"https://api.github.com/users/llllllllll/events{/privacy}","received_events_url":"https://api.github.com/users/llllllllll/received_events","type":"User","site_admin":false},"body":"are you suggesting inlining this to rely only on the tslib function? Isn't tslib also \"private\" but just not prefixed with \"_\"? If that is the case I would leave it like this to make it clear we are using some priivate methods.","created_at":"2016-05-27T17:51:47Z","updated_at":"2016-05-27T17:51:47Z","html_url":"https://github.com/quantopian/zipline/pull/1227#discussion_r64943106","pull_request_url":"https://api.github.com/repos/quantopian/zipline/pulls/1227","_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments/64943106"},"html":{"href":"https://github.com/quantopian/zipline/pull/1227#discussion_r64943106"},"pull_request":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1227"}}},"pull_request":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/1227","id":71102907,"html_url":"https://github.com/quantopian/zipline/pull/1227","diff_url":"https://github.com/quantopian/zipline/pull/1227.diff","patch_url":"https://github.com/quantopian/zipline/pull/1227.patch","issue_url":"https://api.github.com/repos/quantopian/zipline/issues/1227","number":1227,"state":"open","locked":false,"title":"ENH: improve performance of blaze core loader","user":{"login":"llllllllll","id":3064397,"avatar_url":"https://avatars.githubusercontent.com/u/3064397?v=3","gravatar_id":"","url":"https://api.github.com/users/llllllllll","html_url":"https://github.com/llllllllll","followers_url":"https://api.github.com/users/llllllllll/followers","following_url":"https://api.github.com/users/llllllllll/following{/other_user}","gists_url":"https://api.github.com/users/llllllllll/gists{/gist_id}","starred_url":"https://api.github.com/users/llllllllll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llllllllll/subscriptions","organizations_url":"https://api.github.com/users/llllllllll/orgs","repos_url":"https://api.github.com/users/llllllllll/repos","events_url":"https://api.github.com/users/llllllllll/events{/privacy}","received_events_url":"https://api.github.com/users/llllllllll/received_events","type":"User","site_admin":false},"body":"Breaking out what I have now so I don't build up a very large diff.\r\n\r\n1. Only do the lower bound query for the base expression, not the deltas. This was extra work that is not needed.\r\n1. `DatetimeIndex.time >= time` is _really_ slow. Implements a `mask_time_between` which will do the time comparison against the datetime index much more quickly.\r\n1. Upgrade blaze ecosystem. One important change is to drop an unneeded copy in the blaze server/client.\r\n\r\nThis shaves about 1.5s off the tests which is nice.","created_at":"2016-05-23T19:00:06Z","updated_at":"2016-05-27T17:51:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c347f8eed5f10670d25ea1bcbc9b0ea195ef27a9","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/quantopian/zipline/pulls/1227/commits","review_comments_url":"https://api.github.com/repos/quantopian/zipline/pulls/1227/comments","review_comment_url":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quantopian/zipline/issues/1227/comments","statuses_url":"https://api.github.com/repos/quantopian/zipline/statuses/c569a3d571767f74f0ab830be85bcc63b78ff559","head":{"label":"quantopian:blaze-loader-perf","ref":"blaze-loader-perf","sha":"c569a3d571767f74f0ab830be85bcc63b78ff559","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-27T08:37:26Z","pushed_at":"2016-05-26T21:10:24Z","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":57917,"stargazers_count":3238,"watchers_count":3238,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":980,"mirror_url":null,"open_issues_count":142,"forks":980,"open_issues":142,"watchers":3238,"default_branch":"master"}},"base":{"label":"quantopian:master","ref":"master","sha":"d34b1b9224edf2583bcb43d59f78e66eee11debd","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-27T08:37:26Z","pushed_at":"2016-05-26T21:10:24Z","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":57917,"stargazers_count":3238,"watchers_count":3238,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":980,"mirror_url":null,"open_issues_count":142,"forks":980,"open_issues":142,"watchers":3238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1227"},"html":{"href":"https://github.com/quantopian/zipline/pull/1227"},"issue":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1227"},"comments":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1227/comments"},"review_comments":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1227/comments"},"review_comment":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1227/commits"},"statuses":{"href":"https://api.github.com/repos/quantopian/zipline/statuses/c569a3d571767f74f0ab830be85bcc63b78ff559"}}}}
{"actor":{"display_login":"llllllllll"}}