vispy / jupyter_rfb

Remote Frame Buffer for Jupyter
https://jupyter-rfb.readthedocs.io
MIT License
55 stars 10 forks source link

Include output in notebooks #39

Closed almarklein closed 2 years ago

almarklein commented 2 years ago

This makes that our the static view on our example notebooks (e.g. in Github and in our docs) include initial snapshots of the widgets).

A downside is that we're implicitly adding images to the repo (embedded in the notebooks). I think we can assume that our examples won't change much. We're having similar discussions at Vispy right now. Another option could be to host the notebooks in a separate repo, or in a separate branch that we can reset once in a while, but this also add complexity (maintenance burden). @djhoese thoughts?

djhoese commented 2 years ago

My usual thoughts on this are that the notebook examples stored in the git repository should have all outputs cleared. BUT that is for my libraries that aren't visualization tools and aren't jupyter widgets. This project is the opposite of that so maybe it is OK. You could also set a rule that the basic examples are the only ones with images or maybe only a select few of the examples have snapshots. Or if you're worried about space, would it be better for the initial snapshot to be lower-resolution...nah probably not. Most of the examples are almost all black right? At least some of the ones you've embedded in this PR seem pretty small.

My one strong feeling is stay away from git lfs. The limits put on it by GitHub are annoyingly small and when you've hit your limit it is hard to do anything about it.

almarklein commented 2 years ago

Another option could be to let the nbsphynx run the notebooks to produce the outputs. Won't work for all examples, but this should at least get the basic examples to include outputs.

djhoese commented 2 years ago

If that's an option then it may be worth a try. You're using readthedocs right now, right? Is that going to complicate things?

almarklein commented 2 years ago

No, only that we may want to add some dependencies to the docbuilding environment, depending on how many example we want to work.

djhoese commented 2 years ago

Up to you. I think this PR isn't going to be terrible, but maybe taking the time to test automatically generated notebooks would be good for the future.

almarklein commented 2 years ago

I am going to go with the easy option and include the outputs. All notebooks together take up just 1MB and won't change often. I just pushed a change such that the notebooks that include outputs can be run with "restart and run all", and produce the same images on each run.