-
Notifications
You must be signed in to change notification settings - Fork 86
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
Render large dataframes as images icephys tutorials #1469
Conversation
@rly the gallery and readthedocs test pipelines currently fail for this PR. The problem seems to be a missing package |
Have you tried:
If that doesn't work well... Readthedocs does NOT support custom docker images so it will be difficult to install chrome: readthedocs/readthedocs.org#6162 However, we can hack it by calling commands to install chrome or chromium-chromedriver within |
Thanks for the suggestion. I did not see this. I've updated the calls for |
I had to add The gallery tests are currently failing because one of the image files that is being rendered cannot be found. My guess is that maybe the gallery tests are running with a different home so the relative paths may not work. I'll see if I can fix that. |
Codecov Report
@@ Coverage Diff @@
## dev #1469 +/- ##
=======================================
Coverage 77.47% 77.47%
=======================================
Files 37 37
Lines 2735 2735
Branches 455 455
=======================================
Hits 2119 2119
Misses 535 535
Partials 81 81 Continue to review full report at Codecov.
|
@rly It looks like this all working now. Please have a look and see if this looks better now. The following comment is mostly for future reference. There are a couple of caveats to consider with this approach:
|
This looks good to me. Another option to getting around the path issue is to export images to the current directory and use matplotlib or another library to render the image in the docs rather than displaying the image using Sphinx. It's hacky either way. I'd say the current method is good enough. |
Motivation
Fix #1467
Rendering large dataframes in readthedocs is challenging due to the limited horizontal space and lack of horizontal scrolling. The display of some of the tables in the icephys tutorials was sub-optimal because of this, in particular when tables were transposed for display.
This PR uses the
dataframe_image
library to save large tables in the icephys tutorial as PNG images which are then displayed in the docs as regular images.Advantages
Disadvantages
dataframe_image
as a dependency inrequirements-doc.txt
dataframe_image
relies onchrome
so it needs to be installed as well for this to workConclusion Using
dataframe_image
for the purpose of the docs is useful when displaying a very large dataframe in HTML is a challenge. For dataframes that fit the ReadTheDocs layout, rendering the tables directly in HTML with pandas as usual is fine.How to test the behavior?
View the tutorial on readthedocs
Checklist
flake8
from the source directory.