-
Notifications
You must be signed in to change notification settings - Fork 13
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
Simplify process to generate plotting documentation #307
Conversation
|
||
After copying the notebook url from the output, start the `run_snippets.ipynb` notebook | ||
and run through it. For the most part, no interaction is required. The exception is any | ||
bokeh plots which must be manually saved as png (currently only the powerflow snapshot). |
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 think we can use the following:
from bokeh.io import export_png
export_png(plot, filename="plot.png")
to automatically save the plot as png
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.
Couple of issues.. we can get the plot object to pass in using curstate() if output_notebook()
was called too, but the export also required pip install selenium
, and after that I got an error that firefox isn't supported. At that point I gave up.
Should we add a paragraph in index.rst that would explain how to download the zip file and spin up the container so users can run the code snippets? Plots would not be saved but would display only. |
Now that we have docs/run_snippets.ipynb, we probably don't need postreise/plot/demo/plot_tutorial.ipynb. Correct? |
Might not hurt to have both.. the tutorial is more readable, while run_snippets is easier to run and save repeatedly. Maybe we could delete it down the road if it turns out we don't use it. |
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.
Thanks
Purpose
The plots used on the docs website require specific scenarios as well as an environment to run the code snippets. The goal here is to simplify that as much as possible, so we can recreate the content as needed, e.g. to take advantage of new functionality.
What the code is doing
What's involved:
Testing
I ran the notebook and compared the results with currently checked in files. There are a few minor differences, but that is due to inconsistencies in the code snippets, which we can fix separately if needed.
Usage Example/Visuals
If github will render the notebook, that is probably the most useful place to look
Time estimate
20 min