You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sure, there's nothing wrong with nbsphinx!
Actually, the only advantage of jupytext is that it provides an elegant way to only keep the input cells of notebooks under version control.
Jupytext allows to save jupyter notebooks as various text formats (e.g. Rmd or plain python with comments). One of the supported formats is sphinx-gallery, that can be directly rendered by readthedocs if I'm not mistaken.
Using a text-representation of notebooks is great when having them under version control.
But of course the pros/cons apply as you pointed out.
There are different ways of stripping output from jupyter notebooks, several of them can be combined with the git commit workflow. I've played around a bit with them. The only thing I need to make sure is if there is a way that people cannot commit notebooks with output in them to the scanpy repo. The latter is an absolute no go. @grst, committing things in sphinx-gallery format could be a new way. I'll check whether this offers some convenience. In general I'd rather prefer to have the stripped .ipynb files in the repo, as it's done in tensorflow.
@flying-sheep: I'm not worrying about the build time of the docs, that's decently fast in all my tests so far.
@flying-sheep: After a bit of research I've done some time ago, I also don't consider tests based on notebooks a possibility. I made versions of two notebooks running on subsampled data producing ugly looking low-resolution figures, which ensures small test times and prevents the repo from blowing up. For the tutorials, I want extremely high resolution figures and no subsampled data.
I think I should be almost there. Hopefully we'll have the first two notebooks in the Scanpy repo this or next week...
The only thing I need to make sure is if there is a way that people cannot commit notebooks with output in them to the scanpy repo. The latter is an absolute no go.
Should be easy to have that checked by travis
committing things in sphinx-gallery format could be a new way. I'll check whether this offers some convenience.
If you have any questions/issues regarding this approach, don't hesitate to open an issue in the jupytext repo. The maintainer is extremely responsive and willing to help.
I'm doing it like this for now as it's quite a bit less work than getting everything to run on readthedocs, there might indeed be problems with the runtime for building the docs and I think this updated solution isn't so bad after all...
Activity
grst commentedon Nov 22, 2018
you could also consider jupytext + sphinx-gallery for this.
falexwolf commentedon Nov 25, 2018
Why not using https://nbsphinx.readthedocs.io? It works completely fine for me. So, I would simply moved forward with it as soon as there is some bandwidth.
grst commentedon Nov 26, 2018
Sure, there's nothing wrong with nbsphinx!
Actually, the only advantage of jupytext is that it provides an elegant way to only keep the input cells of notebooks under version control.
flying-sheep commentedon Nov 26, 2018
You mean it uses/relies on nbstripout? In that case:
grst commentedon Nov 26, 2018
The idea is the same, but it works differently.
Jupytext allows to save jupyter notebooks as various text formats (e.g.
Rmdor plain python with comments). One of the supported formats issphinx-gallery, that can be directly rendered by readthedocs if I'm not mistaken.Using a text-representation of notebooks is great when having them under version control.
But of course the pros/cons apply as you pointed out.
falexwolf commentedon Nov 26, 2018
There are different ways of stripping output from jupyter notebooks, several of them can be combined with the git commit workflow. I've played around a bit with them. The only thing I need to make sure is if there is a way that people cannot commit notebooks with output in them to the scanpy repo. The latter is an absolute no go. @grst, committing things in sphinx-gallery format could be a new way. I'll check whether this offers some convenience. In general I'd rather prefer to have the stripped
.ipynbfiles in the repo, as it's done in tensorflow.@flying-sheep: I'm not worrying about the build time of the docs, that's decently fast in all my tests so far.
@flying-sheep: After a bit of research I've done some time ago, I also don't consider tests based on notebooks a possibility. I made versions of two notebooks running on subsampled data producing ugly looking low-resolution figures, which ensures small test times and prevents the repo from blowing up. For the tutorials, I want extremely high resolution figures and no subsampled data.
I think I should be almost there. Hopefully we'll have the first two notebooks in the Scanpy repo this or next week...
grst commentedon Nov 27, 2018
Should be easy to have that checked by travis
If you have any questions/issues regarding this approach, don't hesitate to open an issue in the jupytext repo. The maintainer is extremely responsive and willing to help.
falexwolf commentedon Dec 16, 2018
@flying-sheep and anyone interested: I started putting the notebooks on
scanpy-tutorials: https://github.com/theislab/scanpy-tutorials and https://scanpy.readthedocs.io/en/latest/tutorials.html now links to the docs generated fromscanpy-tutorials.I'm doing it like this for now as it's quite a bit less work than getting everything to run on readthedocs, there might indeed be problems with the runtime for building the docs and I think this updated solution isn't so bad after all...
Opinions are welcome!
flying-sheep commentedon Aug 27, 2026
Discussion on scverse/cookiecutter-scverse#40