features icon indicating copy to clipboard operation
features copied to clipboard

Add NbDime to Jupyter Lab

Open gwincr11 opened this issue 3 years ago • 2 comments

Git base notebook diffing is not a great experience, lets make it better! NbDime is a jupyterlab plugin that will help with this and is also what we base notebook diffing on in dotcom so it will bring some consistency to the experience.

gwincr11 avatar Dec 05 '22 17:12 gwincr11

Thanks @gwincr11 👋 This definitely looks like a useful package and +1 for having a consistent experience. Looking at the consumed disk size of this package (& it's dependencies), it takes ~47 MB of disk space.

@Chuxel / @jkeech / @jungaretti / @joshspicer Any thoughts/concerns about adding nbdime package to the Feature?

samruddhikhandale avatar Dec 07 '22 20:12 samruddhikhandale

For the core feature, I think in principle we shouldn't add things that are not mandatory by default. Is this one mandatory/must have?

If not, having an option to specify a list extensions to install would be more flexible. Otherwise there will be an eternal debate as to which ones to add or remove.

But - in either event, for the universal/kitchen sink image, that's a bit more opinionated, so I think the main concern is size there. But, it does seem useful, so we could add the ability to add extensions, then use that from universal.

To say it again, generally I think Jupyter shouldn't be a part of the python feature either for this challenge (it should be its own), but that's a separate discussion. I think the fact this is together is another piece of evidence that we need composite features.

Chuxel avatar Dec 07 '22 22:12 Chuxel

@gwincr11 Hi 👋

Wondering if you have any thoughts on Chuck's comment https://github.com/devcontainers/features/pull/322#issuecomment-1341691077 Thanks!

samruddhikhandale avatar Dec 14 '22 18:12 samruddhikhandale

For the core feature, I think in principle we shouldn't add things that are not mandatory by default. Is this one mandatory/must have?

So, there is an argument to be made towards yes. Jupyter Notebooks are stored as a json structure that is representative of the information needed to re-construct the notebook by a computer. When using Git the diff output by default is a diff of this json structure often containing full binary blocks. NbDime makes Git diffing usable to a human. So if the goal is to give the user a usable Git Diff, then it or a package like it is mandatory. Being that we are GitHub and every thing we want them to accomplish involves Git I think there is a strong case yes.

gwincr11 avatar Dec 14 '22 18:12 gwincr11

Thanks for the detailed explanation. It makes sense.

We recently added a jupyterlab-git to help with with the basic Git version control. I could see jupyterlab-git doing some similar diffing for Jupyter Notebooks as that of nbdime

jupyterlab-git output from Binder demo provided in jupyterlab/jupyterlab-git

image

@gwincr11 Do you know how these two tools compare with one another, also should we install both or favor one?

samruddhikhandale avatar Dec 21 '22 02:12 samruddhikhandale

Oh looks like they just pull in nbdime https://github.com/jupyterlab/jupyterlab-git/blob/0ddaf8dc7068d19a9c94e8645a5f8c467e70e777/setup.cfg#L26

TIL I think we are good here.

gwincr11 avatar Dec 22 '22 01:12 gwincr11