Closed fperez closed 3 years ago
Yes, it's true that I'm kind of reinventing the wheel, but it's actually on purpose. It allows me to learn the Jupyter stack, and also to develop more quickly. I'm also not using https://github.com/jupyter/jupyter_client, and rebooted it in https://github.com/davidbrochart/kernel_driver. And I started a new Python kernel in https://github.com/davidbrochart/quenelles. I'm also a maintainer of the "official" Jupyter projects, and I want to improve them, but we also need to recognize that some of them have accumulated a lot of technological debt, making it hard to approach. With nbterm, I have found the perfect candidate to recode the stack in a lightweight manner.
Fair enough - though in the case of nbformat I think an argument can be made for the user side of the experience: nbformat will validate notebooks, ensure that the writing of complex notebooks is always correct, read older formats, etc. If nbterm becomes a more widely used tool, those might be arguments to consider. Data loss/notebook corruption is a pretty serious concern :)
I have already been able in small tests to damage a notebook, for example this cell:
I had actually run it again inside nbterm, changing it from 1+1
to 1+3
. The prompts should match and the output should say 4
, but it seems nbterm wrote the new cell content but kept the old output. I also see examples where the output of cells isn't shown correctly in nbterm. This is the same exact notebook open simultaneously in Lab and nbterm:
You can see that the outputs aren't correctly shown...
In any case - this is a great and fun project, love what you're doing. I think it has the potential to be very useful in certain contexts, so I hope that on the data loss front it can be 100% robust :)
Thanks for reporting, yes I agree that notebook corruption is a pretty serious issue, I'll work on making nbterm more robust!
Whilenot using nbformat, nbterm is much more robust regarding the notebook format now. Please reopen if you encounter issues.
While it's great that Jupyter notebooks are pure JSON files, I suggest using the nbformat read/write API instead of pure JSON. In practice, your
format.py
is gradually reinventingnbformat
, I think it will be both safer and more productive to reuse nbformat itself.