{"action":"created","comment":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/comments/72479738","id":72479738,"diff_hunk":"@@ -187,37 +201,58 @@ cdef class Asset:\n         \"\"\"\n         return cls(**dict_)\n \n-    def _is_alive(self, dt, bool normalized):\n+    def _is_alive_for_session(self, session_label):\n         \"\"\"\n         Returns whether the asset is alive at the given dt.\n \n         Parameters\n         ----------\n-        dt: pd.Timestamp\n-            The desired timestamp.\n-\n-        normalized: boolean\n-            Whether the date has already been normalized.  If not, we need\n-            to first normalize the date before doing the alive check.  If the\n-            date is already normalized, this method runs up to 80% faster.\n+        session_label: pd.Timestamp\n+            The desired session label to check. (midnight UTC)\n \n         Returns\n         -------\n         boolean: whether the asset is alive at the given dt.\n         \"\"\"\n-        cdef int64_t dt_value\n         cdef int64_t ref_start\n         cdef int64_t ref_end\n \n-        if not normalized:\n-            dt_value = normalize_date(dt).value\n-        else:\n-            dt_value = dt.value\n-\n         ref_start = self.start_date.value","path":"zipline/assets/_assets.pyx","position":69,"original_position":69,"commit_id":"9ca27272cc5bd85b2aaa8523a2bdb7139e9cd01a","original_commit_id":"9ca27272cc5bd85b2aaa8523a2bdb7139e9cd01a","user":{"login":"jbredeche","id":487622,"avatar_url":"https://avatars.githubusercontent.com/u/487622?v=3","gravatar_id":"","url":"https://api.github.com/users/jbredeche","html_url":"https://github.com/jbredeche","followers_url":"https://api.github.com/users/jbredeche/followers","following_url":"https://api.github.com/users/jbredeche/following{/other_user}","gists_url":"https://api.github.com/users/jbredeche/gists{/gist_id}","starred_url":"https://api.github.com/users/jbredeche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbredeche/subscriptions","organizations_url":"https://api.github.com/users/jbredeche/orgs","repos_url":"https://api.github.com/users/jbredeche/repos","events_url":"https://api.github.com/users/jbredeche/events{/privacy}","received_events_url":"https://api.github.com/users/jbredeche/received_events","type":"User","site_admin":false},"body":"Yes.  asset lifetimes are defined as a start and end session.  and futures contracts will expire at the end of a session.","created_at":"2016-07-27T17:04:16Z","updated_at":"2016-07-27T17:04:16Z","html_url":"https://github.com/quantopian/zipline/pull/1346#discussion_r72479738","pull_request_url":"https://api.github.com/repos/quantopian/zipline/pulls/1346","_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments/72479738"},"html":{"href":"https://github.com/quantopian/zipline/pull/1346#discussion_r72479738"},"pull_request":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1346"}}},"pull_request":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/1346","id":78608600,"html_url":"https://github.com/quantopian/zipline/pull/1346","diff_url":"https://github.com/quantopian/zipline/pull/1346.diff","patch_url":"https://github.com/quantopian/zipline/pull/1346.patch","issue_url":"https://api.github.com/repos/quantopian/zipline/issues/1346","number":1346,"state":"open","locked":false,"title":"ENH: time/calendar business logic improvements","user":{"login":"jbredeche","id":487622,"avatar_url":"https://avatars.githubusercontent.com/u/487622?v=3","gravatar_id":"","url":"https://api.github.com/users/jbredeche","html_url":"https://github.com/jbredeche","followers_url":"https://api.github.com/users/jbredeche/followers","following_url":"https://api.github.com/users/jbredeche/following{/other_user}","gists_url":"https://api.github.com/users/jbredeche/gists{/gist_id}","starred_url":"https://api.github.com/users/jbredeche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbredeche/subscriptions","organizations_url":"https://api.github.com/users/jbredeche/orgs","repos_url":"https://api.github.com/users/jbredeche/repos","events_url":"https://api.github.com/users/jbredeche/events{/privacy}","received_events_url":"https://api.github.com/users/jbredeche/received_events","type":"User","site_admin":false},"body":"I pulled in 03f120d3524434e6eb04759e65f9f394ce14b67b because I needed it on this branch, so once that PR is in, I can rebase that commit out.\r\n\r\nThe goal of this PR was to augment `data.can_trade` to also check whether the asset's exchange is open.  To do that, I also needed to move `before_trading_start` to fire at 8:45am (ie, possibly an exchange minute) instead of midnight UTC (a session label), so that got put into this PR too.","created_at":"2016-07-24T20:21:01Z","updated_at":"2016-07-27T17:04:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"895c33a3d2aeb29ed37915e7b6f9f068f605b65b","assignee":{"login":"ehebert","id":185744,"avatar_url":"https://avatars.githubusercontent.com/u/185744?v=3","gravatar_id":"","url":"https://api.github.com/users/ehebert","html_url":"https://github.com/ehebert","followers_url":"https://api.github.com/users/ehebert/followers","following_url":"https://api.github.com/users/ehebert/following{/other_user}","gists_url":"https://api.github.com/users/ehebert/gists{/gist_id}","starred_url":"https://api.github.com/users/ehebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehebert/subscriptions","organizations_url":"https://api.github.com/users/ehebert/orgs","repos_url":"https://api.github.com/users/ehebert/repos","events_url":"https://api.github.com/users/ehebert/events{/privacy}","received_events_url":"https://api.github.com/users/ehebert/received_events","type":"User","site_admin":false},"assignees":[{"login":"ehebert","id":185744,"avatar_url":"https://avatars.githubusercontent.com/u/185744?v=3","gravatar_id":"","url":"https://api.github.com/users/ehebert","html_url":"https://github.com/ehebert","followers_url":"https://api.github.com/users/ehebert/followers","following_url":"https://api.github.com/users/ehebert/following{/other_user}","gists_url":"https://api.github.com/users/ehebert/gists{/gist_id}","starred_url":"https://api.github.com/users/ehebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehebert/subscriptions","organizations_url":"https://api.github.com/users/ehebert/orgs","repos_url":"https://api.github.com/users/ehebert/repos","events_url":"https://api.github.com/users/ehebert/events{/privacy}","received_events_url":"https://api.github.com/users/ehebert/received_events","type":"User","site_admin":false},{"login":"richafrank","id":2123660,"avatar_url":"https://avatars.githubusercontent.com/u/2123660?v=3","gravatar_id":"","url":"https://api.github.com/users/richafrank","html_url":"https://github.com/richafrank","followers_url":"https://api.github.com/users/richafrank/followers","following_url":"https://api.github.com/users/richafrank/following{/other_user}","gists_url":"https://api.github.com/users/richafrank/gists{/gist_id}","starred_url":"https://api.github.com/users/richafrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richafrank/subscriptions","organizations_url":"https://api.github.com/users/richafrank/orgs","repos_url":"https://api.github.com/users/richafrank/repos","events_url":"https://api.github.com/users/richafrank/events{/privacy}","received_events_url":"https://api.github.com/users/richafrank/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/quantopian/zipline/pulls/1346/commits","review_comments_url":"https://api.github.com/repos/quantopian/zipline/pulls/1346/comments","review_comment_url":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quantopian/zipline/issues/1346/comments","statuses_url":"https://api.github.com/repos/quantopian/zipline/statuses/9ca27272cc5bd85b2aaa8523a2bdb7139e9cd01a","head":{"label":"quantopian:check-exchange-time","ref":"check-exchange-time","sha":"9ca27272cc5bd85b2aaa8523a2bdb7139e9cd01a","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-07-27T17:03:50Z","pushed_at":"2016-07-27T15:12:47Z","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":79404,"stargazers_count":3501,"watchers_count":3501,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1074,"mirror_url":null,"open_issues_count":154,"forks":1074,"open_issues":154,"watchers":3501,"default_branch":"master"}},"base":{"label":"quantopian:master","ref":"master","sha":"52f3e91a4b292158b1adf03cd26053b13e7d55e7","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-07-27T17:03:50Z","pushed_at":"2016-07-27T15:12:47Z","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":79404,"stargazers_count":3501,"watchers_count":3501,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1074,"mirror_url":null,"open_issues_count":154,"forks":1074,"open_issues":154,"watchers":3501,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1346"},"html":{"href":"https://github.com/quantopian/zipline/pull/1346"},"issue":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1346"},"comments":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1346/comments"},"review_comments":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1346/comments"},"review_comment":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1346/commits"},"statuses":{"href":"https://api.github.com/repos/quantopian/zipline/statuses/9ca27272cc5bd85b2aaa8523a2bdb7139e9cd01a"}}}}
{"actor":{"display_login":"jbredeche"}}