Forcing notebooks to be saved prior to shutdown

161 views
Skip to first unread message

Tony Hirst

unread,
Jun 19, 2015, 10:17:07 AM6/19/15
to jup...@googlegroups.com
If I shutdown a notebook that has unsaved changes, are those changes necessarily lost?

Under some circumstances, I can see why you might want to shutdown a notebook without a save, but on others can imagine that a user may have just forgotten.

If I try to close a browser window containing a notebook with unsaved changes I get a prompt asking if I really want to do that, so being able to shutdown a notebook with unsaved changes without any prompt seems to afford a less precautionary measure?

From my own experience, I know it's also possible to save a notebook with output cells containing huuuuuge amounts of data that in some cases can cause problems slowing the browser. Would it be useful to have a 'safe mode' way of opening notebooks that essentially clears all the output cells on the way in?

MinRK

unread,
Jun 19, 2015, 1:41:36 PM6/19/15
to jup...@googlegroups.com
On Fri, Jun 19, 2015 at 7:17 AM, Tony Hirst <tony....@gmail.com> wrote:
If I shutdown a notebook that has unsaved changes, are those changes necessarily lost?

No, 'shutdown' actually has no effect on changes being saved or not. 

Under some circumstances, I can see why you might want to shutdown a notebook without a save, but on others can imagine that a user may have just forgotten.

If I try to close a browser window containing a notebook with unsaved changes I get a prompt asking if I really want to do that, so being able to shutdown a notebook with unsaved changes without any prompt seems to afford a less precautionary measure?

Shutting down actually only refers to the kernel associated with a notebook, but doesn't actually have anything to do with the document contents itself. It is not possible for the tree view to save notebooks, since the document state lives entirely in the window with the document open. If there is no such window, there are necessarily no changes that might be lost by shutting it down. Shutting down alone cannot cause lost changes, other than in-memory state of the kernel (the same as restart kernel in the running notebook).

 

From my own experience, I know it's also possible to save a notebook with output cells containing huuuuuge amounts of data that in some cases can cause problems slowing the browser. Would it be useful to have a 'safe mode' way of opening notebooks that essentially clears all the output cells on the way in?

We have hooks in the contents manager now, which allow you to do things like strip output prior to save. We don't yet have a hook to run a filter on open, though.

-MinRK
 

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/5e4ad78f-f654-4441-97a1-fd6884b3d485%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tony Hirst

unread,
Jun 22, 2015, 3:36:19 PM6/22/15
to jup...@googlegroups.com

We have hooks in the contents manager now, which allow you to do things like strip output prior to save. We don't yet have a hook to run a filter on open, though.


Is there any intention to foreground these via the UI somehow? Or would I need to trigger them via custom UI options?

Is there any plan to support a "safe"/filter option on load? 

Matthias Bussonnier

unread,
Jun 22, 2015, 3:48:17 PM6/22/15
to jup...@googlegroups.com, jup...@googlegroups.com
No, no UI, they would activated by default.

What do you mean by safe?

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.

Tony Hirst

unread,
Jun 22, 2015, 5:01:29 PM6/22/15
to jup...@googlegroups.com

What do you mean by safe?

Safe in sense of - by mistake I saved a huge cell output and and I want to clear all the cell outputs as I restart/reload the notebook.

Thomas Kluyver

unread,
Jun 22, 2015, 5:30:11 PM6/22/15
to jup...@googlegroups.com
On 22 June 2015 at 14:01, Tony Hirst <tony....@gmail.com> wrote:
Safe in sense of - by mistake I saved a huge cell output and and I want to clear all the cell outputs as I restart/reload the notebook.

I think for the foreseeable future, it's easier to say that in that case you should run some separate code to strip the output out of the file, and then open it normally. Exposing UI for different kinds of 'open' sounds like it could get complicated.

Thomas
Reply all
Reply to author
Forward
0 new messages