ENH: Adds last_available_{session, minute} args to DataPortal (#1528)

This allows optionally setting the last available dts in the DataPortal
explicitly. If these args aren't provided, we fall back to inferring
these from the underlying readers, which was the previous behavior.
This commit is contained in:
Andrew Daniels
2016-10-06 20:46:54 -04:00
committed by GitHub
parent b6f8a67aad
commit 2f097ead76
4 changed files with 44 additions and 7 deletions
+5
View File
@@ -1265,6 +1265,9 @@ class WithDataPortal(WithAdjustmentReader,
DATA_PORTAL_FIRST_TRADING_DAY = None
DATA_PORTAL_LAST_AVAILABLE_SESSION = None
DATA_PORTAL_LAST_AVAILABLE_MINUTE = None
def make_data_portal(self):
if self.DATA_PORTAL_FIRST_TRADING_DAY is None:
if self.DATA_PORTAL_USE_MINUTE_DATA:
@@ -1300,6 +1303,8 @@ class WithDataPortal(WithAdjustmentReader,
if self.DATA_PORTAL_USE_MINUTE_DATA else
None
),
last_available_session=self.DATA_PORTAL_LAST_AVAILABLE_SESSION,
last_available_minute=self.DATA_PORTAL_LAST_AVAILABLE_MINUTE,
)
def init_instance_fixtures(self):