mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-12 22:52:27 +08:00
Merge pull request #1361 from quantopian/point-in-time-assets-db-again
Point in time assets db again
This commit is contained in:
@@ -781,7 +781,10 @@ class TestTransformAlgorithm(WithLogger,
|
||||
|
||||
@classmethod
|
||||
def make_futures_info(cls):
|
||||
return pd.DataFrame.from_dict({3: {'multiplier': 10}}, 'index')
|
||||
return pd.DataFrame.from_dict(
|
||||
{3: {'multiplier': 10, 'symbol': 'F'}},
|
||||
orient='index',
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def make_equity_daily_bar_data(cls):
|
||||
@@ -989,6 +992,7 @@ def before_trading_start(context, data):
|
||||
'start_date': start_session,
|
||||
'end_date': period_end + timedelta(days=1)
|
||||
}] * 2)
|
||||
equities['symbol'] = ['A', 'B']
|
||||
with TempDirectory() as tempdir, \
|
||||
tmp_trading_env(equities=equities) as env:
|
||||
sim_params = SimulationParameters(
|
||||
@@ -2849,6 +2853,7 @@ class TestTradingControls(WithSimParams, WithDataPortal, ZiplineTestCase):
|
||||
metadata = pd.DataFrame.from_dict(
|
||||
{
|
||||
1: {
|
||||
'symbol': 'SYM',
|
||||
'start_date': start,
|
||||
'end_date': start + timedelta(days=6)
|
||||
},
|
||||
@@ -2976,6 +2981,7 @@ class TestTradingControls(WithSimParams, WithDataPortal, ZiplineTestCase):
|
||||
|
||||
def test_asset_date_bounds(self):
|
||||
metadata = pd.DataFrame([{
|
||||
'symbol': 'SYM',
|
||||
'start_date': self.sim_params.start_session,
|
||||
'end_date': '2020-01-01',
|
||||
}])
|
||||
@@ -2995,6 +3001,7 @@ class TestTradingControls(WithSimParams, WithDataPortal, ZiplineTestCase):
|
||||
algo.run(data_portal)
|
||||
|
||||
metadata = pd.DataFrame([{
|
||||
'symbol': 'SYM',
|
||||
'start_date': '1989-01-01',
|
||||
'end_date': '1990-01-01',
|
||||
}])
|
||||
@@ -3015,6 +3022,7 @@ class TestTradingControls(WithSimParams, WithDataPortal, ZiplineTestCase):
|
||||
algo.run(data_portal)
|
||||
|
||||
metadata = pd.DataFrame([{
|
||||
'symbol': 'SYM',
|
||||
'start_date': '2020-01-01',
|
||||
'end_date': '2021-01-01',
|
||||
}])
|
||||
|
||||
Reference in New Issue
Block a user