[IPython-dev] Thoughts on the notebook format for version control

Fernando Perez fperez.net@gmail....
Sat Nov 5 21:58:47 CDT 2011


On Sat, Nov 5, 2011 at 7:41 PM, MinRK <benjaminrk@gmail.com> wrote:
> On Sat, Nov 5, 2011 at 18:58, Fernando Perez <fperez.net@gmail.com> wrote:
>>

> There is a *huge* disadvantage in portability to notebooks not being single
> files.  I think this still makes
> sense, though.  I would treat the output as a 'cache' (along the lines of
> .pyc / __cache__),
> rather than considering the notebook itself as a multi-file format.  And you
> should be able
> to embed the outputs in a single file if you want, for easier portability.
> Doing it this way would not require changing the notebook format, because
> current (output-included)
> notebooks would still comply with the spec.

I agree that it's a big inconvenience for everyday, non-VC use.  I
like the idea of making it optional, it can be a flag set in the
metadata dict, that indicates whether to keep outputs in the cache or
internally (and also to offer the single-file download option).


> I think this sounds like a good start, with the only change that we still
> allow (optionally) outputs in a single file via the download button, rather
> than the notebook format being canonically multifile, which is just too
> painful.

Yes, that sounds like a good balance between everyday usability and
being VC-friendly.

> I think the key-order issue you mention in the addendum is easily fixed by
> specifying `sort_keys=True` in the json dump.

That's great to hear, I thought we'd have to do the sorting manually.
That's a change we should make right away then, since it doesn't
change the format.  People can manually remove outputs from their
notebooks and this will help if they use VC a little bit (even if the
singe-line cells issue isn't fixed yet).

Thanks for the feedback!

Cheers,

f


More information about the IPython-dev mailing list