-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Enable Jupyter Sphinx Extension in docs? #1379
Comments
Thanks for the thorough summary @Peque! Just to have something to look at, here's the result of naively replacing ipython w/ jupyter-execute:
Of course blocks of code with multiple outputs only show the last output now, so a little restructuring would be needed. Also, it seems like |
@kanderso-nrel Yeah, it seems Jupyter does not show If the IPython directive was to be replaced I agree some restructuring would be needed. Either by splitting code into multiple cells or by using I also think some CSS adjustments would be necessary in order to make it look better (mostly margins). |
By the way, it seems It looks like it is used to illustrate how the functions/methods are implemented (i.e.: to show the source code of the function). @wholmgren was that the intention? If so, maybe |
Yes. Have the jupyter/ipython developers provided any guidance on the future of either tool? |
@wholmgren What do you mean by that? Maybe we can ask them. 😊 |
My impression is that ipython directive was largely abandoned for at least a few years as development focused on notebooks and then jupyter lab. It's been a little finicky. Maybe this jupyter extension will be more reliable? |
@wholmgren It's true that the directive had 3 commits in the last 2 years, and the documentation still states:
PS: Cross-referencing jupyter/jupyter-sphinx#36. |
@Peque and @kandersolar, might be worth looking at nbshpinx. I use it in pvcaptest to create the examples, which are just ipynb files. I think the ability to setup mybinder to run these examples is a very nice bonus to this approach. |
I've used nbsphinx a fair bit for projects that use ipynb files with sphinx (e.g. the pvlib tutorials, the engagement tracker, the unofficial psm3 user guide, and the RdTools gallery). It has worked well for me for the most part. However I am not enthusiastic about the source for these pvlib docs pages being in .ipynb format; ipynb files are annoying to collaborate on in git/github, even after recent github improvements. I put up with it for those other projects because some unique feature of ipynb files (e.g. storing pre-calculated results) was needed but I don't think that's the case here. Having "launch on binder/colab/whatever" buttons would definitely be nice but I'm not sure it's worth switching to ipynb just for that. |
While writing documentation, I noticed the extended use of the IPython Sphinx Directive.
I bet most pvlib users like to play with pvlib in interactive environments. However, I think Jupyter Notebooks are getting more common/widespread when compared to IPython consoles. I wondered if it would be acceptable to allow code in the documentation to look more like notebooks instead of consoles.
There is this extension called Jupyter Sphinx, under the umbrella of the Jupyter organization.
I think it could have a couple of advantages:
@savefig
)In [xx]:
, which makes it harder to read, copy and pasteA couple of (maybe) disadvantages:
??
does not work (only used inmodelchain.rst
); see Some IPython commands are not getting executed jupyter/nbclient#196 (maybe replaceable bysphinx-code-include
)The text was updated successfully, but these errors were encountered: