Skip to content
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

Allow users to provide extra rows in the top table #445

Merged
merged 2 commits into from
Oct 5, 2017
Merged

Conversation

gusgordon
Copy link
Contributor

This allows users to pass in extra rows (as a dict or OrderedDict) to display in the perf_stats table. They can pass header_rows to create_full_tear_sheet, create_simple_tear_sheet, create_returns_tear_sheet, show_perf_stats, and print_table. HTML will be generated and injected into the top of the table. Also puts the dates/ranges here, below the rows that the user passes.

Also clean up a few random doc strings.

Examples:
screen shot 2017-09-27 at 1 14 14 pm

2

@@ -81,7 +81,7 @@ def create_full_tear_sheet(returns,
factor_returns=None,
factor_loadings=None,
pos_in_dollars=True,
return_fig=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, for some reason we were accepting this argument but it wasn't being used anymore. return_fig is only used for the create_tear_sheet functions that produce one figure with multiple plots, like the returns tear sheet (the full tear sheet produces a bunch of figures). I am surprised this got by flake8 in the past.

@twiecki
Copy link
Contributor

twiecki commented Sep 27, 2017

Great feature. Is this off of recent master?

@gusgordon
Copy link
Contributor Author

Yeah off recent master. I will re-run tests once Travis starts passing on master, I think @vikram-narayan is working on that.

@joshpayne
Copy link

Cool! I'm curious - what problem is this solving for the pyfolio user?

@gusgordon
Copy link
Contributor Author

@joshpayne we can use this internally to print metadata (code name, revision, etc.) about the algos within the tear sheet. Users can print their name, etc in here if they want to show this tear sheet to people. It also formats the dates at the top using the same function, whereas before they were just strings tacked on.

@gusgordon gusgordon merged commit d107f85 into master Oct 5, 2017
@gusgordon gusgordon mentioned this pull request Oct 9, 2017
@gusgordon gusgordon deleted the table-header branch November 2, 2017 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants