-
Notifications
You must be signed in to change notification settings - Fork 4.9k
ENH: move the data_query_time to the domain #2288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty painless! I had a couple requests for more test coverage and clarifications in docstrings, and one question about timezone expectations.
zipline/pipeline/domain.py
Outdated
Returns | ||
------- | ||
data_query_cutoff : pd.DatetimeIndex | ||
The sessions at the given data query time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"At the given query time" is a bit confusing since there's no cutoff time being provided to this function.
zipline/pipeline/domain.py
Outdated
|
||
def data_query_cutoff_for_sessions(self, sessions): | ||
return days_at_time( | ||
sessions.tz_localize('UTC'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is sessions
always expected to be tz-naive? I would have expected our normal midnight UTC convention here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the tests, it appears to never be localized, meaning we are passing unlocalized dts to pipeline loaders.
zipline/pipeline/domain.py
Outdated
Name of the calendar, to be looked by by trading_calendar.get_calendar. | ||
data_query_offset : datetime.timedelta | ||
The offset from market open when data should no longer be considered | ||
available for a session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example might be helpful here, e.g. "For example, a data_query_offset of -timedelta(minutes=45) signifies that data must have been available 45 minutes prior to market open for it to appear in pipeline inputs for a given day."
787d5d2
to
f0e75cf
Compare
f0e75cf
to
7dad5f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I had a few questions, and I posted a few updates to the tests in commits at the end of this PR.
No description provided.