mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-15 11:22:18 +08:00
MAINT: Adds first_trading_day arg to DataPortal
Instead of inferring it from the minute/daily writer, we now require the first trading day to be passed explicitly, so the creator of the DataPortal controls what is used as the first trading day.
This commit is contained in:
@@ -3372,9 +3372,11 @@ class TestEquityAutoClose(WithTmpDir, ZiplineTestCase):
|
||||
BcolzDailyBarWriter(path, dates).write(
|
||||
iteritems(trade_data_by_sid),
|
||||
)
|
||||
reader = BcolzDailyBarReader(path)
|
||||
data_portal = DataPortal(
|
||||
env,
|
||||
equity_daily_reader=BcolzDailyBarReader(path)
|
||||
first_trading_day=reader.first_trading_day,
|
||||
equity_daily_reader=reader,
|
||||
)
|
||||
elif frequency == 'minute':
|
||||
dates = env.minutes_for_days_in_range(
|
||||
@@ -3400,9 +3402,11 @@ class TestEquityAutoClose(WithTmpDir, ZiplineTestCase):
|
||||
volume_step_by_date=10,
|
||||
frequency=frequency
|
||||
)
|
||||
reader = BcolzMinuteBarReader(self.tmpdir.path)
|
||||
data_portal = DataPortal(
|
||||
env,
|
||||
equity_minute_reader=BcolzMinuteBarReader(self.tmpdir.path)
|
||||
first_trading_day=reader.first_trading_day,
|
||||
equity_minute_reader=reader,
|
||||
)
|
||||
else:
|
||||
self.fail("Unknown frequency in make_data: %r" % frequency)
|
||||
|
||||
Reference in New Issue
Block a user