-
Notifications
You must be signed in to change notification settings - Fork 4.9k
ENH: Add default index names to pipeline results #1997
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
base: master
Are you sure you want to change the base?
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 fine to me. I think ideally we'd have consistent pluralization of the column names, but my gut is that that consistency isn't worth breaking all the downstream code that's using those fields.
Do you have a sense of how much breakage we'd be taking on if we changed the names?
zipline/pipeline/engine.py
Outdated
@@ -32,6 +32,11 @@ | |||
from zipline.utils.sharedoc import copydoc | |||
|
|||
|
|||
DATE_INDEX_NAME = 'dates' |
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.
It bothers me that dates
is plural here but sid
is singular. It's probably not worth breaking all the consumers of this to make the names consistent though :(.
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.
I'll change it to sids
. All of the downstream consumers currently change the name of the index from (None, None), to (dates
, sid
).
zipline/pipeline/engine.py
Outdated
@@ -32,6 +32,11 @@ | |||
from zipline.utils.sharedoc import copydoc | |||
|
|||
|
|||
DATE_INDEX_NAME = 'dates' | |||
SID_INDEX_NAME = 'sid' | |||
PIPELINE_INDEX_NAMES = (DATE_INDEX_NAME, SID_INDEX_NAME) |
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.
I'd probably put these in zipline.pipeline.common
instead of in engine.
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.
Good point, moving them.
6ef43dc
to
dbf1305
Compare
dbf1305
to
f0af00d
Compare
1 similar comment
f0af00d
to
ce7b654
Compare
Improve legibility of pipeline result manipulations by adding names to the multi-index.