{"action":"created","comment":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/comments/58970821","id":58970821,"diff_hunk":"@@ -522,158 +525,145 @@ def test_overnight_adjustments(self):\n                 self.assertEqual(value, expected[field])\n \n \n-class TestDailyBarData(TestBarDataBase):\n-    @classmethod\n-    def setUpClass(cls):\n-        cls.tempdir = TempDirectory()\n-\n-        # asset1 has a daily data for each day (1/5, 1/6, 1/7)\n-        # asset2 only has daily data for day2 (1/6)\n-\n-        cls.env = TradingEnvironment()\n-\n-        cls.days = cls.env.days_in_range(\n-            start=pd.Timestamp(\"2016-01-05\", tz='UTC'),\n-            end=pd.Timestamp(\"2016-01-08\", tz='UTC')\n-        )\n-\n-        cls.env.write_data(equities_data={\n-            sid: {\n-                'start_date': cls.days[0],\n-                'end_date': cls.days[-1],\n-                'symbol': \"ASSET{0}\".format(sid)\n-            } for sid in [1, 2, 3, 4, 5, 6, 7, 8]\n-        })\n-\n-        cls.ASSET1 = cls.env.asset_finder.retrieve_asset(1)\n-        cls.ASSET2 = cls.env.asset_finder.retrieve_asset(2)\n-        cls.SPLIT_ASSET = cls.env.asset_finder.retrieve_asset(3)\n-        cls.ILLIQUID_SPLIT_ASSET = cls.env.asset_finder.retrieve_asset(4)\n-        cls.MERGER_ASSET = cls.env.asset_finder.retrieve_asset(5)\n-        cls.ILLIQUID_MERGER_ASSET = cls.env.asset_finder.retrieve_asset(6)\n-        cls.DIVIDEND_ASSET = cls.env.asset_finder.retrieve_asset(7)\n-        cls.ILLIQUID_DIVIDEND_ASSET = cls.env.asset_finder.retrieve_asset(8)\n-        cls.ASSETS = [cls.ASSET1, cls.ASSET2]\n+class TestDailyBarData(WithBarDataChecks,\n+                       WithDataPortal,\n+                       ZiplineTestCase):\n+    SIM_PARAMS_START = pd.Timestamp('2016-01-05', tz='UTC')\n+    SIM_PARAMS_END = pd.Timestamp('2016-01-08', tz='UTC')\n \n-        cls.adjustments_reader = cls.create_adjustments_reader()\n-        cls.data_portal = DataPortal(\n-            cls.env,\n-            equity_daily_reader=cls.build_daily_data(),\n-            adjustment_reader=cls.adjustments_reader\n-        )\n+    sids = set(range(1, 9))\n \n-    @classmethod\n-    def tearDownClass(cls):\n-        cls.tempdir.cleanup()\n+    SPLIT_ASSET_SID = 3\n+    ILLIQUID_SPLIT_ASSET_SID = 4\n+    MERGER_ASSET_SID = 5\n+    ILLIQUID_MERGER_ASSET_SID = 6\n+    DIVIDEND_ASSET_SID = 7\n+    ILLIQUID_DIVIDEND_ASSET_SID = 8\n \n     @classmethod\n-    def create_adjustments_reader(cls):\n-        path = cls.tempdir.getpath(\"test_adjustments.db\")\n-\n-        adj_writer = SQLiteAdjustmentWriter(\n-            path,\n-            cls.env.trading_days,\n-            MockDailyBarReader()\n+    def make_equity_info(cls):\n+        return pd.DataFrame.from_dict(\n+            {\n+                sid: {\n+                    'start_date': cls.SIM_PARAMS_START,\n+                    'end_date': cls.SIM_PARAMS_END,\n+                    'symbol': \"ASSET{0}\".format(sid)\n+                } for sid in cls.sids\n+            },\n+            orient='index',\n         )\n \n-        splits = pd.DataFrame([\n+    @classmethod\n+    def make_splits_data(cls):\n+        return pd.DataFrame.from_records([\n             {\n                 'effective_date': str_to_seconds(\"2016-01-06\"),\n                 'ratio': 0.5,\n-                'sid': cls.SPLIT_ASSET.sid\n+                'sid': cls.SPLIT_ASSET_SID,\n             },\n             {\n                 'effective_date': str_to_seconds(\"2016-01-07\"),\n                 'ratio': 0.5,\n-                'sid': cls.ILLIQUID_SPLIT_ASSET.sid\n-            }\n+                'sid': cls.ILLIQUID_SPLIT_ASSET_SID,\n+            },\n         ])\n \n-        mergers = pd.DataFrame([\n+    @classmethod\n+    def make_mergers_data(cls):\n+        return pd.DataFrame([","path":"tests/test_bar_data.py","position":454,"original_position":469,"commit_id":"f996989bb48bf74e1f02f183bea7d7f81b67ac34","original_commit_id":"9f2bd48a76290cef8d92d7e0890e410e41e4b38d","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":"I don't care deeply either way, but it seems like we should be consistent here.  Maybe slight preference for `from_records`?","created_at":"2016-04-08T01:39:29Z","updated_at":"2016-04-08T01:39:29Z","html_url":"https://github.com/quantopian/zipline/pull/1109#discussion_r58970821","pull_request_url":"https://api.github.com/repos/quantopian/zipline/pulls/1109","_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments/58970821"},"html":{"href":"https://github.com/quantopian/zipline/pull/1109#discussion_r58970821"},"pull_request":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1109"}}},"pull_request":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/1109","id":65209230,"html_url":"https://github.com/quantopian/zipline/pull/1109","diff_url":"https://github.com/quantopian/zipline/pull/1109.diff","patch_url":"https://github.com/quantopian/zipline/pull/1109.patch","issue_url":"https://api.github.com/repos/quantopian/zipline/issues/1109","number":1109,"state":"open","locked":false,"title":"MAINT: make the data loading apis more consistent.","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":"Changes BcolzDailyBarWriter to not be an abc, data is passed as an\r\niterator of (sid, dataframe) pairs to the write method.\r\n\r\nChanges the AssetsDBWriter to be a single class which accepts an engine\r\nat construction time and has a `write` method for writing dataframes for\r\nthe various tables. We no longer support writing the various other data\r\ntypes, callers should coerce their data into a dataframe themselves. See\r\nzipline.assets.synthetic for some helpers to do this.\r\n\r\nAdds a lot of test fixtures and updates many tests to use these. This\r\nwas done in the process of updating the tests that used one of the\r\nwriters above.\r\n\r\nref:  #1108. #1100","created_at":"2016-04-04T20:40:07Z","updated_at":"2016-04-08T01:39:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fceb1f4ac2a2ceb096a4eb4a6c89f5773b5baa26","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/quantopian/zipline/pulls/1109/commits","review_comments_url":"https://api.github.com/repos/quantopian/zipline/pulls/1109/comments","review_comment_url":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quantopian/zipline/issues/1109/comments","statuses_url":"https://api.github.com/repos/quantopian/zipline/statuses/f996989bb48bf74e1f02f183bea7d7f81b67ac34","head":{"label":"quantopian:make-loader-apis-more-clear","ref":"make-loader-apis-more-clear","sha":"f996989bb48bf74e1f02f183bea7d7f81b67ac34","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-04-07T20:29:44Z","pushed_at":"2016-04-08T00:34:12Z","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":17603,"stargazers_count":3058,"watchers_count":3058,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":902,"mirror_url":null,"open_issues_count":153,"forks":902,"open_issues":153,"watchers":3058,"default_branch":"master"}},"base":{"label":"quantopian:master","ref":"master","sha":"34f47da033c4f3beb55b464515007a98b9a22e69","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-04-07T20:29:44Z","pushed_at":"2016-04-08T00:34:12Z","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":17603,"stargazers_count":3058,"watchers_count":3058,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":902,"mirror_url":null,"open_issues_count":153,"forks":902,"open_issues":153,"watchers":3058,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1109"},"html":{"href":"https://github.com/quantopian/zipline/pull/1109"},"issue":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1109"},"comments":{"href":"https://api.github.com/repos/quantopian/zipline/issues/1109/comments"},"review_comments":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1109/comments"},"review_comment":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quantopian/zipline/pulls/1109/commits"},"statuses":{"href":"https://api.github.com/repos/quantopian/zipline/statuses/f996989bb48bf74e1f02f183bea7d7f81b67ac34"}}}}